9.9 C
London
Sunday, October 29, 2023

Meta constructed threads in solely 5 months utilizing Jetpack Compose



Posted by Yasmine Evjen – Product Supervisor, and Florina Muntenescu – Developer Relations Engineer

Following its launch in July of 2023, Meta’s Threads grew to become essentially the most quickly downloaded app ever with over 100 million downloads in its first week. Meta created the brand new text-based social media platform as a spot to construct connections and have significant conversations. To make sure the app was arrange for fulfillment at its launch and into the long run, Threads builders used Jetpack Compose, Android’s fashionable declarative toolkit for constructing UI.

A neater approach to construct UI with Jetpack Compose

Threads is constructed on high of current code from its sister app Instagram, which makes use of Views for its UI improvement. After constructive stories from different Android builders about Compose, and following inner testing and an evaluation of the toolkit’s advantages, Threads engineers opted to construct the all-new app from scratch utilizing Compose. By utilizing Compose, the workforce may transfer quicker and higher put together the app for any future updates.

“We determined Jetpack Compose could be our goal UI framework going ahead,” mentioned Richard Zadorozny, a software program engineer at Threads. “We needed to construct the brand new app UI from scratch utilizing Compose as a result of it might allow us to maneuver quicker than refactoring a big utility like Instagram.”

Although most of Threads’ engineers had no prior expertise utilizing Compose, they discovered it simple to get began and study the brand new toolkit. With Compose, Threads engineers constructed and shipped the app in solely 5 months. This vastly exceeded the workforce’s velocity expectations for growing a high-quality Android utility — particularly of this complexity and scale. The workforce attributes a lot of this velocity to the flexibleness and decoupling Compose supplied.

Compose helped Threads engineers streamline the event of recent product options. The modular nature of the toolkit let Threads builders iterate on the app because it developed and teed up the app’s structure for future improvement. Compose additionally helped engineers construct user-friendly options that adhered to Materials Design pointers.

Threads was built and shipped in five months, exceeding our speed expectations for building a high-quality Android app of this complexity and scale.”  — Richard Zadorozny, software engineer at Threads

Going all in with Compose

Threads engineers developed virtually the entire app’s surfaces utilizing Compose. In the long run, they constructed over 90% of Threads utilizing Compose, together with the app’s exercise feed, navigation, search, profiles, onboarding web page, shared aspect transitions, media viewer, settings, and extra.

Whereas Compose did largely every thing Threads engineers wanted it to, it was nonetheless simple for them to interoperate with Views as vital. They used Views for Threads’ movies and the media picker that’s out there when creating a brand new submit.

Compose offers fashionable APIs that ship straight with an app. Due to this, Threads engineers spent much less time worrying about backward compatibility, lacking options, or differing performance between totally different variations of Android. As a substitute, they may focus their vitality on growing a high-quality utility.

“Compose’s design encourages a modular, plug-in strategy to improvement,” mentioned Richard. “Modifiers make all kinds of performance inherently reusable, so that you not should subclass sophisticated ViewGroups or lump all kinds of logic into one place.”

Moving image shows Jetpack Compose/Modifiers code appears on screen

The Threads workforce used Modifiers for the app’s customized click on behaviors and its thread line illustration that seems on the left aspect of posts. Modifiers additionally allowed Threads builders to simply add the app’s branding to any parts and ensured they had been correctly aligned on-screen.

Threads engineers additionally ensured the app was prepared for customers throughout platforms at launch. That meant ensuring Threads resizes to work on totally different units, like massive screens and foldables. The adaptive layouts Compose gives guarantee an app responds correctly to totally different display screen sizes, orientations, and kind components. This made it simpler for the Threads app to “simply work” for configuration modifications, in line with Richard.

For developers who are building new apps, I would definitely recommend using Compose. Not only is it enjoyable… it sets your team up for success in the future.” — Richard Zadorozny, software engineer at Threads

Compose is the ‘future’ of Android UI

Compose provided Threads builders a better approach to design and create UI whereas making ready the app’s structure for the long run. With its intuitive composables and fashionable declarative framework, Compose made end-to-end improvement easy and gave Threads builders confidence that updating the app could be simple.

Given the constructive outcomes the workforce noticed with the discharge of Threads, Meta plans to increase its use of Compose to a few of Instagram’s most necessary surfaces, just like the app’s essential feed.

“It’s reached some extent the place Jetpack Compose can do virtually every thing you’ll want, and its modular nature makes it simple to make a lot of the modifications you would wish to fill the gaps,” mentioned Richard. “I consider Compose is the way forward for Android UI improvement, and it’s simply enjoyable!”

Get began

Optimize your UI improvement with Jetpack Compose.

Latest news
Related news

LEAVE A REPLY

Please enter your comment!
Please enter your name here