Illustration by Virginia Poltrack

Now in Android #54

Welcome to Now in Android, your ongoing guide to what’s new and notable in the world of Android development. It has been a long time since our last real update; our last blog was focused on some notable moments of 2021, so this edition might be better titled “Recent in Android.”

The same content from this post, but with less detail and infinitely more talking.

Jetpack Alpha for Glance Widgets 🔍

We made the first release of Jetpack Glance available, a new framework designed to make it faster and easier to build app widgets for the home screen and other surfaces. Glance offers similar modern, declarative Kotlin APIs that you are used to with Jetpack Compose, helping you build beautiful, responsive app widgets with way less code. Glance provides a base-set of its own Composables to help build “glanceable” experiences — starting today with app widget components but with more coming. Using the Jetpack Compose runtime, Glance translates these Composables into RemoteViews that can be displayed in an app widget.

Jetpack Watch Face Library ⌚

We launched the Jetpack Watch Face library written from the ground up in Kotlin, including all functionality from the Wearable Support Library along with many new features such as:

  • Watch face styling which persists across both the watch and phone (with no need for your own database or companion app).
  • Support for a WYSIWYG watch face configuration UI on the phone.
  • Smaller, separate libraries (that only include what you need).
  • Battery improvements through promoting good battery usage patterns out of the box, such as automatically reducing the interactive frame rate when the battery is low.
  • New screenshot APIs so users can see previews of their watch face changes in real time on both the watch and phone.

If you are still using the Wearable Support Library, we strongly encourage migrating to the new Jetpack libraries to take advantage of the new APIs and upcoming features and bug fixes.

Rebuilding our Guide to App Architecture 📐

We launched a revamped guide to app architecture which includes best practices. As Android apps grow in size, it’s important to design the code with an architecture in place that allows the app to scale, improves quality and robustness, and makes testing easier. The guide contains pages for UI, domain, and data layers including deep dives into more complex topics, such as how to handle UI events. We also have a learning pathway to walk you through it.

Google Play Games on PC Beta 🎮

We announced that we’re opening sign-ups for Google Play Games on PC as a beta in Korea, Taiwan, and Hong Kong, allowing users participating in the beta to play a catalog of Google Play games on their PC via a standalone application built by Google. The developer site has a form to express interest, along with information about bringing your Android game to PCs. It involves many of the same updates that you do to optimize your game for Chrome OS devices, such as support for Mouse and Keyboard controls.

MAD Skills: Gradle and DataStore 💡

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

MAD Skills: Gradle 🐘

We closed out our series on Gradle and the Android Gradle Plugin APIs.

Firstly, covered building custom plugins in more depth, including the Artifact API in addition to the Variant API covered previously. It demonstrates building a plugin which automatically updates the version code specified in the app manifest with the git version. With the AGP 7.0 release, you can use these APIs to control build inputs, read, modify, or even replace intermediate and final artifacts.

Next, , maintainer of the Gradle Play Publisher and Version Orchestrator plugins, offers a tutorial on how to manipulate your Android build artifacts with the AGP and Gradle APIs.

Then, we did a live Q&A around Gradle and AGP build APIs, where was joined by , , and .

This wrap-up post summarizes the whole series.

MAD Skills: DataStore 🗄️

began MAD Skills: DataStore. DataStore is a thread-safe, non-blocking library in Android Jetpack that provides a safe and consistent way to store small amounts of data, such as preferences or application state, replacing SharedPreferences. It provides an implementation that stores typed objects backed by protocol buffers (Proto DataStore) and an implementation that stores key-value pairs (Preferences DataStore).

More MAD Content

But Wait! If this wasn’t enough, there’s More MAD content!

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.

AndroidX releases 🚀

Since the last Now in Android episode, a lot of libraries were promoted to stable! Compose ConstraintLayout brings support for ConstraintLayout syntax to Compose. We also released CoordinatorLayout 1.2, Car App 1.1.0, Room 2.4.0, Sqlite 2.2.0, Collection 1.2.0, and Wear Watchface 1.0.0.

Our first alpha of Jetpack Compose 1.2 was released, along with alphas for Glance 1.0.0, Core-Ktx 1.8.0, WorkManager 2.8.0, Mediarouter 1.3.0, Emoji2 1.1.0, Annotation 1.4.0, Core-RemoteViews, Core-Peformance, and more.

You can see all the AndroidX release notes here.

Articles 📚

wrote about the recent updates to Jetnews that improves its behavior across big and small mobile devices. It describes our design and development process so that you can learn our philosophy and associated implementation steps for building an application optimized for all screens with Jetpack Compose, including how to build a list/detail layout.

wrote about drag & drop, and how the Android Jetpack DragAndDrop library alpha makes it easier to handle data dropped into your app.

Accessibility series 🌐

The accessibility series continues on, beginning with an episode on how to properly implement UI elements that disappear after a set amount of time.

We also cover how Accessibility Scanner can help you improve your app for all users by suggesting improvements in areas of accessibility.

Finally, we investigate how Espresso and the Accessibility Test Framework can help you create automated accessibility tests.

In addition to the accessibility series, we have resources to help you learn more about Accessibility on Android, and how to build more accessible Android apps.

Android TV & Google TV 📺

covered best practices for the Watch Next API on Android TV & Google TV, which increases engagement with your app by allowing your content to show up in the Watch Next row.

ADB Podcast Episodes🎙

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

In Episode 179: Flibberty Widget, and talked with Nicole McWilliams and Petr Čermák from the London engineering office about their work on App Widgets and Digital Wellbeing.

In Episode 180: Kotlin Magic Platform, , , and talked with from the Android Toolkit Team about Kotlin multi-platform.

In Episode 181: Architecture → Fewer bugs at the end, and chatted with (again!) from the Android Toolkit Team and from the Android Developer Relations team about application architecture. The team has released new architecture guidance, and we talk about that guidance here, as well as how our architecture recommendations apply in the new Jetpack Compose world.

Now then… 👋

That’s it for this time from “now and recent” in Android, with the Gradle and DataStore MAD Skills series, AndroidX releases, articles about Compose across multiple screen sizes, and drag and drop. We launched the Jetpack Glance alpha, the Jetpack Watch Face library, our revamped guide to app architecture, and the beta of Google Play Games on PCs. We covered the Watch Next API for TV, and had podcasts covering Widgets, Kotlin Multiplatform, and Architecture. Come back here soon for the next update from the Android developer universe.

--

--

Daniel Galpin
Android Developers

Developer Advocate at Google, writer, editor, theatrical performer, and social dancer.