Image for post
Image for post
Illustration by Virginia Poltrack

Now in Android #29

App Bundles, AndroidX stable releases, Kotlin articles and videos, and a new ADB podcast episode

Chet Haase
Nov 11 · 6 min read

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

MAD Skills: App Bundles

Image for post
Image for post

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:

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:

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).

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. The next series begins next week: stay tuned!

AndroidX

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:

Classy Data

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 equals() and 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:

Built-in Delegates

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: lazy, observable, vetoable, and notNull.

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.

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, hashCode() != equals(), and more. Check out the post for all of the details.

Podcast Episodes

Image for post
Image for post

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.

Now then…

That’s it for this time. So go learn about App Bundles! Download the latest AndroidX releases! Read recent articles about Kotlin! Listen to the latest ADB podcast episode! And come back here soon for the next update from the Android developer universe.

Android Developers

The official Android Developers publication on Medium

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store