Now in Android: December 12, 2019

#9: Articles, searchable AOSP, Material Components samples, improved storage guides, and the latest ADB podcast episodes

Welcome to Now in Android, your ongoing guide to what’s new and notable in the world of Android development.

Articles

We published a few articles recently that are worth checking out.

Chris Banes posted these two articles on using Kotlin coroutines to wrap UI callbacks, allowing you to orchestrate them easily. The first explains how it all works, while the second covers a specific example in detail.

Also in the vein of asynchronous programming, Manuel Vivo published this article talking about how the ADS scheduling app (the app we used for the conference which we open-sourced recently) uses Kotlin Flows for asynchronous streams of data. In particular, how Flow modeled session data coming from either the web or a local cache.

Isai Damier explains how developers can migrate their code from the platform version of biometric APIs (such as FingerprintManager) to the new Jetpack Biometric library (which uses the appropriate platform APIs under the hood). By moving to the Jetpack Biometric library, you can use this single API to target multiple versions of Android, back to API level 23.

Navigating Android’s Source Code

Android has always been open source, ever since 1.0. But open doesn’t necessarily translate to easy-to-navigate.

So a team here at Google took some internal tools and made them work on the AOSP repository, so now you can easily search and navigate all of the Android source code. For example, you can click on items to find their declarations and references.

View.java is big. Really big.

For kicks, I loaded View.java. It took a while and the system complained that the file was so large the browser might crash. (Nobody likes the line count of View.java — not even the search site). But it worked.

For more information, check out the article on the Android Developers Blog. Or better yet, just go to cs.android.com and try it out.

Material Components Samples

The Material Design Components team collaborated with folks from Design Relations and Developer Relations to come up with some new samples, showing how to implement Material theming.

The new samples are based on design studies on the Material Design site

The samples start from fictional Material studies, which offer a detailed view of the design goals and details of each project. They then show how to use the Material Design Components to achieve those goals, with the customization capabilities that the components enable.

Storage Wars

Casters. A solution looking for a problem. And a storage location.

I have this problem of where to put things in my garage. I put together or take apart some piece of furniture and end up with random hardware, like a set of casters. They’re still perfectly functional, and maybe I’ll want them for some future project (optimistic, unlikely, but theoretically possible). But where do I put them? I don’t have a cabinet for storing casters. So they end up where everything ends up when I don’t know what to do with it; on my workbench (which further prevents me from using my workbench or ever getting to projects like building an item that might need, say, casters).

The problem is not that there is nowhere to store these random items, it’s that there are too many possible places, and it’s hard to decide on the right place, or a standard location, so I end up using random places, or the catch-all workbench, instead. This makes it hard to actually find those items in the future if and when I ever need them.

Similarly, Android has many different places to store application data. And, similarly, it can be confusing to figure out what to put where. Or which APIs to use in storing the data. Are you storing documents? media? preferences? App-private data, or data that should be shared? Would you like to use internal or external storage? What about database information?

There are now many storage guides to help you understand where to put your data

Fortunately, there’s a new set of guides that the docs and engineering teams created to help understand all of the options and how to use them. Learn how to store and access files meant for use only by your app, and how to share media and other kinds of files with other apps on a device. Also, check out the app compatibility page for more information to help you support the latest releases of Android.

Don’t store your data like I store things in my garage.

ADB Podcast Episodes

There have been a few episodes of Android Developers Backstage posted since the last Now in Android. Check them out at the links below, or in your favorite podcast client:

Tor, Jerome, Chris, and Xav

ADB 127: Gradle to Crave

In which Tor chats with Jerome Dochez, Chris Warrington and Xavier Ducrohet from the Android Studio build system team.

We forgot to take a photo for this episode. Please use your imagination.

ADB 128: Play with App Bundles

In which Chet and Florina Muntenescu (from the Android Developer Relations team) talk with Dom Elliott from the Google Play team about Android App Bundles and other recent Google Play developer features.

’Tis the [Tracker] Season

santatracker.google.com

Santa Tracker is back for this holiday season, and the elves have been hard at work on this season’s Android app, which has a new integration with the website, new games and more. As usual, we will open-source the app early next year: watch the GitHub repo for updates.

If you celebrate the holidays, Happy Holidays!

Otherwise, Happy Friday!

Now then…

That’s it for this time, in this final 2019 episode of Now in Android. Go read some articles on coroutines and Flow and the new biometric library! Search AOSP! Learn about how to use our many storage APIs and build Material UIs! Go listen to the ADB podcast! Track Santa! And come back here soon for the next update from the Android developer universe.