Now in Android text within a phone frame above an Android logo, surrounded by various callouts and UI elements.
Illustration by Virginia Poltrack

Now in Android #39

Android Studio 4.2 & Hilt, Google Play changes, #MAD skills:Navigation, Background Task Inspector, cold to hot Flows

Daniel Galpin
Android Developers
Published in
4 min readMay 13, 2021

--

Android Studio 4.2 released to stable channel

Android Studio 4.2 is now available in the stable release channel. Read the blog for detailed information on what’s new, including a new tool to help migrate your project to the latest Android Gradle Plugin version. We’ve also enhanced lots of stuff such as Database Inspector, System Trace, SafeArgs support, Apply Changes, and the new project wizard. As always, download here and file issues here.

Hilt is stable and ready for production

wrote about the stable release of Hilt, Android Jetpack’s recommended dependency injection (DI) solution for Android apps. Hilt is a simpler, more opinionated way to leverage the power of the Dagger DI library, eliminating boilerplate and reducing errors. It provides direct injection support for popular Jetpack libraries such as ViewModel, WorkManager, Navigation, and Compose. (DI Basics, Documentation)

Google Play updates

Google Play announced upcoming policy changes around app metadata, such as prohibiting certain keywords in the icon, title and developer name. There are also new guidelines for the feature graphics, screenshots, videos, and short descriptions in your listing. The blog has all the details, including the timeframe for rolling out the changes.

Play also blogged about an upcoming safety section to give users more transparency and control over their data. To that end, we’ll ask you to share information about what type of identifying data you collect and store, how that data is used, and to implement a privacy policy.

MAD Skills: Navigation

In MAD Skills, our place to highlight Modern Android Development, continued the ongoing series on Navigation around a coffee and donut tracking app.

In episode #2 , shows how to add conditional navigation to allow people to navigate directly to a Fragment that tracks both coffee and donuts, or a Fragment that tracks just donuts. (donuts without coffee!?) He also covers how to build a test for conditional navigation.

For people who prefer reading their content, here it is in article form:

Episode #3 covers nested and included navigation graphs, and how to use them to help modularize the app.

Nested/included graphs, the article:

But Wait, There’s More!

For ongoing content, be sure to check the MAD Skills playlist on YouTube, the articles on Medium, or this handy landing page that points to all of it.

Articles

wrote about using the shareIn and stateIn operator, which are used to convert cold Kotlin coroutine flows to hot flows, allowing you to cache, buffer content, and multicast information to multiple collectors.

wrote about the new Background Task Inspector in Android Studio and how you can use it to monitor/debug WorkManager (2.5.0+) workers.

ADB Podcast Episodes

There have been a couple of episodes of Android Developers Backstage posted since the last Now in Android.

Episode #161: , , and talk with Rohit Sathyanarayana and about DataStore, a library that replaces SharedPreferences.

Episode #162: chats with Jeffrey van Gogh, Ting-Yuan Huang, and about Kotlin Symbol Processing (KSP), a new, faster, and better tool to replace annotation processors.

Now then…

That’s it for this time. Read about all you can do in Android Studio 4.2. Simplify your DI with Hilt. Check out the metadata and safety posts from Google Play. Watch the latest episodes in the MAD Skills:Navigation series. Read articles on transforming Flows and the new Background Task Inspector. Listen to us chat about DataStore and Kotlin Symbol Processing. Make sure to watch all of the announcements at Google I/O from May 18th-20th. And come back here soon for the next update from the Android developer universe.

--

--

Daniel Galpin
Android Developers

Developer Advocate at Google, writer, editor, theatrical performer, and social dancer.