Thursday, July 4, 2024

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 turned probably 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 achievement at its launch and into the longer term, Threads builders used Jetpack Compose, Android’s fashionable declarative toolkit for constructing UI.

A better technique 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 reviews from different Android builders about Compose, and following inside testing and an evaluation of the toolkit’s advantages, Threads engineers opted to construct the all-new app from scratch utilizing Compose. Through the use of Compose, the staff may transfer sooner 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 will allow us to maneuver sooner than refactoring a big software like Instagram.”

Though 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 tremendously exceeded the staff’s velocity expectations for growing a high-quality Android software — particularly of this complexity and scale. The staff attributes a lot of this velocity to the flexibleness and decoupling Compose supplied.

Compose helped Threads engineers streamline the event of latest 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 tips.

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 nearly 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 factor transitions, media viewer, settings, and extra.

Whereas Compose did largely all the pieces Threads engineers wanted it to, it was nonetheless simple for them to interoperate with Views as needed. 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 immediately 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 power on growing a high-quality software.

“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 need to subclass difficult ViewGroups or lump all kinds of logic into one place.”

Moving image shows Jetpack Compose/Modifiers code appears on screen

The Threads staff 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 components 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 provides 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 adjustments, in accordance 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 neater technique to design and create UI whereas making ready the app’s structure for the longer term. 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 staff noticed with the discharge of Threads, Meta plans to increase its use of Compose to a few of Instagram’s most vital surfaces, just like the app’s important feed.

“It’s reached some extent the place Jetpack Compose can do nearly all the pieces you’ll want, and its modular nature makes it simple to make a lot of the adjustments you would want 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.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles