Author/Product Manager Anna-Chiara Bellini and Developer relations Engineer Nick Butcher
We’ve launched Jetpack Compose Beta, our new UI toolkit designed to help developers build native apps faster and easier across all Android platforms. Compose provides a new generation of declarative Kotlin apis that help you build beautiful, responsive applications with less code. The toolkit was built to integrate with existing Android apps and Jetpack development libraries, and you can combine Android views with Compose and apply Compose at your own pace.
In this Beta, Compose’s apis are built and have all the capabilities needed to build production-usable applications. Beta also means that the API is relatively stable, so we won’t change or remove the API. It’s a good time to start learning about Compose now and start planning how you’ll use the toolkit for upcoming projects or functions once version 1.0 is released this year.
Beta features at a glance
Our team has been developing Compose in an open manner, with active community participation and feedback. Since opening source in 2019, we have released 30 public releases, addressed more than 700 Bug feedback, and adopted more than 200 external contributions. We look forward to seeing what you build with Compose, optimizing our API and prioritizing our work based on your feedback and feature requests. Since the launch of Alpha, we have added and improved several new features:
- 🆕 coroutine support
- 🆕 Talkback accessibility support: Support for other technologies will be released in a stable release
- 🆕 easy to use animation, and a new API released after the Alpha release
- Interoperability with views
- Material UI components, all with sample code
- Lazy list: Added RecyclerView to Jetpack Compose
- Dsl-based Constraint Layout
- The modifier
- test
- Themes and graphics can easily support dark/light color modes
- Input and gesture
- Text and editable text
- The Window management
Development of this Beta toolkit focused on ensuring API completion; In other words, all the base apis were built and we were able to continue building on that for 1.0 and beyond. Until release 1.0, we will focus on ensuring the stability of these apis with a strong focus on application performance and accessibility.
Compose Beta is now supported by the latest Android Studio Arctic Fox Canary release, which offers many new tools:
- 🆕 Live Literals: Update text in real time on previews and devices or emulators
- 🆕 Animation preview: Check and play the animation
- Compose support in 🆕 layout inspector
- 🆕 Interactive preview: Examine and interact with individual composables
- 🆕 Deployment preview: Deploy Composable on your device without the full application
Live Literals on Android Emulator
Layout inspector for Jetpack Compose
Compatible with existing applications
Jetpack Compose is designed to work seamlessly with Android views, making it easy for you to apply the toolkit at your own pace. You can embed the Compose UI in the Android view and use the view in Compose. We provide multiple application strategies in the interoperability documentation.
In addition to view interoperability, we’ve integrated common development libraries to help you add Compose to your existing applications without having to rewrite or redesign them. We provide integration with the following components:
- Navigation
- ViewModel
- LiveData / Rx / Flow
- Paging
- Hilt
The MDC Compose theme adapter and STRINGS IST development library provide integration with Material and AppCompat XML themes so you don’t need to copy theme definitions. Csist also provides a packaged container suitable for common image loading libraries.
Compose’s programming ideas
Jetpack Compose is a declarative UI toolkit and a paradigm shift from current view systems that allows you to declare how the UI is expected to look in any given application state, rather than how it is generated. Compose takes care of updating your UI when the application state changes, so you can change it to the desired state without having to manipulate the interface, eliminating tedious process and avoiding errors.
Compose is built entirely using Kotlin and takes advantage of its excellent language features to provide a powerful, concise, and intuitive API. For example, with the help of coroutines, we can write simpler asynchronous apis, such as describing gestures, animations, or scrolling. This makes it easier to write code that combines asynchronous events, such as gestures that trigger animations, with the cancellation and cleanup that structured concurrency provides.
Start learning about Compose
To help you and your team learn everything there is to know about Jetpack Compose, we’ve updated the learning plan along with a series of well-planned videos, Codelab, and key documentation to help you get started. We’ve also released new and updated documentation guides, some video demos, and a new animated Codelab to help you get a deeper understanding of how to build with Compose. We provide tutorials to help you get started quickly, with architecture, accessibility, and testing tutorials, as well as an in-depth look at the programming ideas for animations, lists, or Compose.
We’ve also provided eight official sample apps to get you started and see Compose in action. These examples range from simple to complex, and each demonstrates a different API and use case. See readme for more details.
#AndroidDevChallenge: Learn Compose and win prizes
If you’re ready to start learning Compose and want to win some prizes along the way, check out #AndroidDevChallenge. We’ve launched a series of weekly challenges to help you form your own insights into Jetpack Compose and successfully complete your project. Keep up to date with the latest week’s challenges and participate to win more than 1,000 prizes, including Google Pixel 5! The second week of the challenge is underway, click here to learn more.
With the Beta release of Jetpack Compose, a stable API and features for version 1.0 have been built. Now is a good time to start learning about Jetpack Compose and plan how to use the toolkit in your upcoming projects. We look forward to receiving your feedback on incorporating Compose into our app. You can also contribute to the discussion on Kotlin Slack’s # Compose channel or share with us in the comments below.