Posted by
Anna-Chiara Bellini, Product Manager, Nick Butcher, Developer Relations

The Android Show: Jetpack Compose, Feb. 24 at 9am PT

Today, we’re launching the beta launch of Jetpack Compose, our new UI toolkit designed to make it quicker and simpler to construct native apps throughout all Android platforms. Compose gives fashionable, declarative Kotlin APIs, serving to you construct stunning, responsive apps with means much less code. Built to combine with present Android apps and Jetpack libraries, you possibly can undertake Compose at your personal tempo by combining Android Views and Compose.

With this beta launch, Compose is API full and has all of the options you should construct production-ready apps. Beta additionally means API secure, so we gained’t change or take away APIs. Now is a good time to start out studying Compose and start planning for the way you’ll use it in an upcoming mission or function as soon as it reaches 1.0 later this yr.

What’s In Beta

Our group has been creating Compose within the open with suggestions and participation from the group. Since open sourcing growth in 2019, we’ve had 30 public releases, addressed over 700 exterior bugs, and accepted over 200 exterior contributions. We love seeing what you’ve been constructing with Compose and have used your suggestions and have requests to refine our APIs and prioritize our work. Since the alpha launch, we’ve added and improved numerous new options:

  • 🆕 Coroutines assist
  • 🆕 Accessibility assist for Talkback – assist for different applied sciences shall be in Stable
  • 🆕 Easy to make use of Animations, with a very new API since alpha.
  • Interoperability with Views
  • Material UI Components, all with @Sampled code
  • Lazy Lists – Jetpack Compose’s tackle RecyclerView
  • DSL-based Constraint Layout
  • Modifiers
  • Testing
  • Theming and Graphics, with straightforward assist for Dark and Light mode
  • Input and gestures
  • Text and editable textual content
  • Window administration

For the beta launch, we’ve been targeted on guaranteeing API completeness; that each one foundational APIs are in place for us to proceed to construct upon for 1.0 and past. We’ll work on stabilizing these APIs as much as our 1.0 launch with specific give attention to app efficiency and accessibility.

Compose Beta is supported by the most recent Canary of Android Studio Arctic Fox, which options many new instruments:

    🆕 Live Literals: actual time replace of literals in Preview and on machine or emulator

    🆕 Animation Preview: examine and playback animations

    🆕 Compose assist within the Layout Inspector

    🆕 Interactive preview: examine and work together with a Composable in isolation

    🆕 Deploy Preview: to deploy a Composable in your machine while not having a full app

Live Literals on Android Emulator

Layout Inspector for Jetpack Compose

Works together with your present app

Jetpack Compose is designed to work seamlessly with Android Views, letting you undertake at your personal tempo. You can embed Compose UIs inside Android Views and use Views inside Compose. We lay out numerous adoption methods in our interoperability documentation.

In addition to View interop, we combine with widespread libraries that can assist you so as to add Compose to your present functions—no have to rewrite or re-architect your app. We supply integrations with:

  • Navigation
  • ViewMannequin
  • LiveInformation / Rx / Flow
  • Paging
  • Hilt

The MDC-Android Compose Theme Adapter and Accompanist libraries present integrations with Material and AppCompat XML themes so that you don’t have to duplicate theme definitions. Accompanist additionally gives wrappers for widespread picture loading libraries.

Thinking in Compose

Jetpack Compose is a declarative UI toolkit, a paradigm shift from the present View system, the place you describe what your UI ought to seem like for a given software state, not how to supply it. Compose takes care of updating your UI when your app state adjustments, so that you don’t have to govern your UI into the specified state which will be tedious and error susceptible.

Built totally in Kotlin, Compose takes benefit of its nice language options to supply highly effective, succinct, intuitive APIs. Coroutines for instance allow us to put in writing a lot easier async APIs similar to describing gestures, animation or scrolling. This makes it simpler to put in writing code that mixes async occasions, like a gesture which fingers off to an animation, all with cancellation and clean-up supplied by structured concurrency.

Learning Compose

To provide help to and your group be taught all about Jetpack Compose, we’ve up to date our studying pathway; a curated record of movies, hands-on codelabs and key docs to get you began. Today we’re releasing new & up to date documentation guides, numerous screencasts and a brand new Animation Codelab to assist dive deeper into how you can construct with Compose. From steering on structure, accessibility and testing, to deep dives into animation, lists or considering in Compose, now we have guides that can assist you stand up to hurry.

We additionally supply 8 official pattern functions if you wish to leap straight in and see Compose in motion. We have easy to advanced samples, every showcasing totally different APIs and use circumstances. Check the readme for extra particulars.

#AndroidDevChallenge: be taught Compose and win prizes

If you’re able to get began with Compose–and in addition need to win some prizes alongside the best way, try the #AndroidDevChallenge. For the subsequent 4 weeks, we’ll have weekly challenges designed to present your very personal insights into Jetpack Compose, so you possibly can fly via your initiatives. Compete to win new prizes for every problem, with over one thousand prizes to win together with a Google Pixel 5. You can learn extra in regards to the first weekly problem – beginning right this moment – proper right here.

With Jetpack Compose reaching Beta—with secure APIs and have full for 1.0—it is a good time to start out studying Jetpack Compose and planning the way you may use it in an upcoming mission. We’d love to listen to your suggestions on adopting Compose in your app or be part of the dialogue within the Kotlin Slack #compose channel.