Now in Android #29
App Bundles, AndroidX stable releases, Kotlin articles and videos, and a new ADB podcast episode
Welcome to Now in Android, your ongoing guide to what’s new and notable in the world of Android development.
MAD Skills: App Bundles
The MAD Skills series continues to roll on, with technical content about modern Android development. Wojtek Kaliciński and Ben Weiss have posted a few episodes in the second series on App Bundles. So far, we’ve seen content on Play App Signing, Building your First App Bundle, and Play Feature Delivery. Check out the videos and articles below below to learn more.
Episode 1: Everything to know about Play App Signing
In a series about Android App Bundles, it’s natural to talk about app signing, because Play generates APKs for download to user devices, and those APKs have to be signed in order to be installed. This video walks you through the steps to enable signing for an app on the Play Console, including options for having a key generated by Google or uploading your own key.
Be sure to check out Wojtek’s related article on common questions about Play App Signing:
Answers to common questions about App Signing by Google Play
Here is some advice on enabling app signing by Google Play, based on questions our Developer Relations team has heard…
Episode 2: Building your first app bundle
Ben’s video walks you through the steps of creating an App Bundle, which you can do either in Android Studio or on the command line, followed by uploading it to the Play Console. He also shows how to use tools in Play Console to explore information about the uploaded bundle.
Episode 3: Configuring your App for Play Feature Delivery
This episode shows how to use Android Studio to modularize your application, and how to select modules to be downloaded at install time (with optional conditions determining whether to install or not) or on demand. Ben also goes into some detail on how to use the APIs to request on-demand module installation.
Or in article form:
Configuring your app for Play Feature Delivery
This article is available as a video and linked at the end of the post. The Android App Bundle is the publishing format…
Episode 4: Testing with bundletool and Play Console
In this final episode, Wojtek explains how to use the available tools to test your bundle and resulting APKs, including bundletool for local testing as well as Play Console for testing uploads.
There are several articles and docs linked from the video description, be suree to check those out for even more info on the topic.
Stay tuned for the final App Bundles content next week, when we will host a live Q&A next Thursday (a YouTube live link will appear in the playlist by then, plus we’ll tweet out a call for questions before then).
Amidst the plethora of incremental alpha, beta, and RC releases of AndroidX libraries, there were some important stable versions launched recently that I wanted to call your attention to.
- ConstraintLayout 2.0.4: The most important change here was actually in version 2.0.2 (also recent), which had important performance optimizations. But pick up the latest version for the extra bugfixes since then.
The performance gains come from ConstraintLayout’s being much smarter about when it can skip running the solver and avoid multiple measurement and solver passes. This allows for big performance wins in many common situations. For example, hierarchies with tons of GONE views and views using match constraint (
layout_[height|width]=”0dp”) can be significantly faster to layout.
- Startup 1.0.0: The app startup library was developed to make it easier for apps to initialize components at startup in a more optimal way than they might be doing otherwise. It turns out that initializing a single ContentProvider takes a significant amount of time, and many apps initialize more than one of them — often many more of them. Startup allows your app to initialize components without creating several ContentProviders (spoiler: the library creates and uses a single ContentProvider under the hood for all requests), allowing your app to skip most of that overhead.
- Tracing 1.0.0: This library writes trace events to the system trace buffer. Instrumenting your app with trace events can be used to provide enhanced information about performance that you can then see by using the Perfetto tool (or Systrace on older devices). See the guide on system tracing for more details on how to do this.
This “new” library isn’t providing new functionality, per se, but it’s providing functionality from the existing TraceCompat class in a very targeted way so that you don’t have to pull in all of androidx.core for this limited functionality. There’s also a helpful KTX extension function which makes it simple to add tracing around a given block of code.
Articles & Videos: Kotlin, Kotlin, Kotlin, and Kotlin
We don’t always talk about Kotlin, but when we do, we talk a lot. There were several articles and videos posted about Kotlin recently:
Florina Muntenescu added another episode in the ongoing Kotlin Vocabulary series, this time about Kotlin data classes. Data classes allow you to easily create a structure for holding data with less boilerplate code, while relying on Kotlin to automatically generate appropriate
hashCode() functions. You also get destructuring for the class’s properties out of the box, along with
copy(). As usual for Kotlin Vocabulary episodes, Florina explores the decompiled bytecode for data classes to explain how it all works under the hood.
Or in article form:
Speaking of Kotlin Vocabulary, Murat Yener posted a sequel to his earlier article on Kotlin’s delegate feature. This time, he discusses the delegates provided by the Kotlin Standard Library:
Should I Learn Kotlin for Android? (and Other FAQs)
The short answer is… Yes!
But for a longer explanation, Florina posted this article to answer some of the top questions we get from developers about investing in Kotlin education and development, and includes links to important learning resources.
Should I learn Kotlin for Android and other FAQs
Ever since we announced our Kotlin support in 2017 we’ve been getting a lot of questions about Kotlin on Android: you…
Fewer Crashes and More Stability with Kotlin
In this article, Florina discusses some of the reasons why Kotlin apps are less error-prone than apps not written in Kotlin. She points out some specific apps and use cases which back up this assertion, but also discusses some of the reasons why this language allows for more robust code, including nullability,
equals(), and more. Check out the post for all of the details.
Fewer crashes and more stability with Kotlin
Users expect to have a seamless experience with your app. Crashes can lead to an increase in poor reviews, uninstalls…
There’s been another episode of Android Developers Backstage posted since the last Now in Android. Check it out at the link below, or in your favorite podcast client:
ADB 152: Image Loading with Coil
Romain Guy, Tor Norbye and I talked with Colin White from Instacart about his open source image loading library, Coil. We chat about image loading, performance, open source, and the use of Kotlin and coroutines to make this Kotlin-first library.