Now in Android #30
App Bundles, Material Design Components, new Target API requirements, new fragment and flow docs, and several articles and videos
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.
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:
MAD Skills - Become an Android App Bundle expert
The Android App Bundle series of Modern Android Development has just concluded. We finished off with a live Q&A…
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:
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.
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:
- 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.
- App updates will need to target API level 30.
New Android App Bundle and target API level requirements in 2021
In 2021, we are continuing with our annual target API level update, requiring new apps to target API level 30 (Android…
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:
Fragments | Android Developers
A represents a reusable portion of your app's UI. A fragment defines and manages its own layout, has its own lifecycle…
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
SharedFlow APIs. Also be sure to check out the video on using flow (which I’ll talk about down below).
Kotlin flows | Android Developers
In coroutines, a flow is a type that can emit multiple values sequentially, as opposed to suspend functions that return…
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.
Testing App Startup Performance
Testing launch performance can be tricky, but it doesn’t have to be
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.
Migrating from Dagger to Hilt — Is it worth it?
The following are some reasons whether your team should invest migrating from Dagger to Hilt.
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.
A pragmatic guide to Hilt with Kotlin
An easy way to use dependency injection in your Android app
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.
The future of Kotlin Android Extensions
The Android Kotlin Extensions Gradle plugin (not to be confused with Android KTX) was released in 2017 and brought two…
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.
Tips for getting your app approved for background location access
When it comes to privacy, we are committed to giving users control and transparency over data access. Users…
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.