Illustration by Virginia Poltrack

Now in Android #30

App Bundles, Material Design Components, new Target API requirements, new fragment and flow docs, and several articles and videos

Chet Haase
Android Developers
Published in
6 min readDec 2, 2020

--

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

NiA30 in Video and Podcast Form

This Now in Android is also offered in video and podcast form. It’s the same content, but with less reading required. The article version (keep reading!) is still the place to come for links to all of the content that’s covered.

Video

Podcast

Click on the link below, or just subscribe to the podcast in your favorite client app.

MAD Skills: App Bundles & Material Design Components

The MAD Skills series continues to roll on, with new technical content about modern Android development.

The series on App Bundles finished up with a tip from Google Developer Expert Angelica Oliveira and then a live+recorded Q&A with me (asking the Q’s) plus Ben Weiss, Wojtek Kaliciński, and Iurii Makhno (supplying the A’s). You can find all of the App Bundles episodes (in video and article form) linked in the wrap-up blog:

Last week, MAD Skills continued with a new series on Material Design Components, the library that simplifies building applications using the Material Design guidelines.

First up was an episode from Nick Butcher on why we recommend that Android developers use Material Design Components. The video includes an overview on the various things that MDC offers, including theming support, built-in transitions, and default Material-styled components:

This content was also covered in an earlier article:

Next, Nick Rout posted an episode on Material Theming, walking through the MaterialThemeBuilder sample project to show you how to use and customize material themes:

In addition to the video, you can also check out the recent articles on MDC theming for color, typography, and shape.

This week, Chris Banes posted the third episode on creating a dark theme with MDC by using both Android 10’s Force Dark feature and MDC’s DayNight theme.

Chris also published this content in article form recently:

We have more MDC content landing this week, plus another live Q&A happening next Thursday. Stay tuned to the MDC playlist for the details.

For ongoing MAD 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.

App Bundle and Target API Requirements

There will be requirements for both target API (for new and updated apps) and App Bundles in late 2021. Hoi Lam posted a blog with all of the details. Briefly:

August 2021:

  • New apps will need to target API level 30.
  • New apps will need to use App Bundles for publishing to the Play Store.
  • New apps with assets or features over 150MB will need to deliver them via Play Asset Delivery and/or Play Feature Delivery. Expansion files (OBBs) will no longer be supported for new apps.

November, 2021:

  • App updates will need to target API level 30.

Documentation

Fragmented Docs

Fragments provide an important architectural element for UI developers, allowing you to manage smaller chunks of your app’s UI in a self contained way. Whether you’re using Navigation with fragments or using fragments on their own, it’s good to know how to best use them in your app. We know how important thorough, up-to-date documentation is for understanding how to use the tools and APIs. While deprecated APIs tell you what to avoid, it is the documentation that should point you in the correct direction and explain the best practices.

So the team has substantially rewritten the Fragment documentation, offering clearer and more up-to-date guidance on various aspects of Fragments, including lifecycles, state, testing, and more. Check out the latest docs (including the subsections linked at the bottom) here:

Ian Lake, who has been fixing and enhancing Fragments in AndroidX, annotated these doc changes in his twitter feed.

Kotlin Flows

There’s also a whole new set of documentation on Kotlin flow, with information on everything from the basics of using flow to testing to the new StateFlow and SharedFlow APIs. Also be sure to check out the video on using flow (which I’ll talk about down below).

Articles & Videos

Testing Startup Performance

I posted an article last week on how to automate some aspects of application startup performance. I’ve been looking into startup performance in general, and wanted to find a reasonable, automated way to derive startup duration for many consecutive runs. I published my approach for anyone that is similarly interested in startup performance testing.

Dagger -> Hilt

In his article, Migrating from Dagger to Hilt, Manuel Vivo poses the question, “Is it worth it?” (Spoiler alert: “Probably… but it depends on your situation.”)

The article covers some of the significant reasons to consider migrating, including testing APIs, consistency, and integration with AndroidX extensions.

Getting Started with Hilt

Speaking of Hilt, Filip Stanis posted this article to help developers get started with Hilt, even those with no prior experience in Dependency Injection or in Dagger. So if this is all new to you, then read on.

While the title implies that the article is for Kotlin developers, that’s really about the code snippets in the article. The general approaches and techniques in the article are applicable to developers using the Java programming language as well.

Going with the Flow

Manuel Vivo posted a new video in the Kotlin Vocabulary series which discusses the use of Kotlin flow for emitting a stream of data. It builds on his earlier video, The ABC of Coroutines, so you might want to watch that one first to… get in the flow.

Kotlin Extensions: View Binding vs Synthetics

David Winer published a blog discussing Kotlin Synthetics as well as View Binding (both of which are mechanisms for eliminating those pesky findViewById() calls in your code). The article points out that synthetics will be deprecated in a future version of the Kotlin plugin (for reasons detailed in the article). The piece also discusses the @Parcelize extension, which will continue to be recommended and supported.

Background Location

There have been many changes in recent Android releases around protecting user data and giving users more control and transparency over how their data is accessed. One of the major areas of focus has been in location, as users may not want applications having access to that data, and may want to control that access very carefully.

Along those lines, Google Play policy will soon require that apps which need access to location while running in the background request permission (from the Play Store) for that access. This article details the process for requesting it.

Now then…

That’s it for this time. So go MAD for App Bundles and Material Design Components! Check out next year’s requirements for App Bundles and Target API! Read the latest docs on Fragments and Kotlin flow! Check out the latest developer content on the Android Developers publication on Medium, the Android Developers Blog, and the Android Developers channel on YouTube! And come back here soon for the next update from the Android developer universe.

--

--

Chet Haase
Android Developers

Android and comedy. Not necessarily in that order.