Android Developers
Published in

Android Developers

Illustration by Virginia Poltrack

Now in Android #64

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

Episode 64 Video and Podcast

Now in Android is also offered as a video and podcast.

The less reading-intensive version of this content…

Developer-Powered CTS (CTS-D) 🧪

The Compatibility Test Suite (CTS) is a key part of the Android Compatibility Program that helps to ensure that devices provide a stable, consistent environment for your apps. To enhance CTS, we are adding a new test suite called CTS-D that is built and run by developers like you. You can build and contribute test cases to CTS-D to help catch pain points that you are seeing in the field — places where device behavior doesn’t match the Android public APIs and the Android Compatibility Definition Document (CDD). Anyone can run the CTS-D suite to verify compatibility, since it’s open-sourced and available on AOSP. If you are interested in learning more, we have tutorials on contributing to and utilizing CTS-D.

Independent versioning of Jetpack Compose libraries ✒️

We announced that the various Jetpack Compose libraries will move to independent versioning schemes, making it easier to incrementally upgrade your application and stay up-to-date with the latest Compose features.

The first library with independent versioning is the Compose Compiler, which is tightly coupled with the Kotlin version. Compose Compiler 1.2.0 brings support for Kotlin 1.7.0 while being both backwards and forwards compatible with the Compose UI libraries and the Compose Runtime library; you can upgrade your Compose Compiler to 1.2.0 stable and use Kotlin 1.7.0 while leaving your other Compose libraries on their current version.

Moving the Compiler library to a different versioning scheme is the first step in decoupling versioning for the different Compose library groups. Prepare your build for individual versioning and start using the latest Compose Compiler and Kotlin versions now!

Notes from Google Play: making Play work for everyone ▶️

In the latest edition of Notes from Google Play, we touched on the Play Integrity API, the Data Safety section, the Privacy Sandbox on Android, and the newly-launched Google Play SDK Index, which provides data and insights about over 100 of the most widely used commercial SDKs. We covered new subscription capabilities that allow you to create multiple base plans and offers for each subscription, as well as the option to lower prices starting at the equivalent of 5 US cents to adapt to local purchasing power.

We shared the story of OLIO, a community-driven app that is fighting to reduce food waste, began the Google Play coffee break series with Jimjum studios, one of the finalists in last years’ Indie Games Accelerator and Indie Games Festival program, and launched the #WeArePlay campaign that celebrates the global community of people behind apps and games.

Dark theme testing in Pre-Launch Report 🕶️

After you upload and publish a test Android App Bundle to Google Play, we install it on a set of Android devices, launch and crawl your app for several minutes, and compile your results into the pre-launch report. We’ve introduced a new test in the Pre-Launch Report that runs accessibility checks on a device switched to dark theme; this can detect color contrast issues that make it difficult to differentiate text and icons from a background. You can also use the screenshots generated during the test to check that all elements in your UI have dark theme styling applied correctly or if you missed styling any of the elements.

Videos 📹

The Performance tips to achieve App Excellence video covered five app performance issues along with the tools that Android Studio and Google Play Console provide to help you diagnose and troubleshoot them.

Articles 📰

This week in articles, Todd covered behavior changes with Intent Filters in Android 13, which now delivers intents that specify actions and originate from external apps to an exported component if and only if the intent matches its declared <intent-filter> elements.

Rebecca covered using AnimatedContent to transition between different composables with a smoother and more custom transition effect. Even the default behavior of AnimatedContent can make a big difference to the look and feel of your app, without much effort.

Ben did a detailed exploration of how Compose determines the stability of each parameter of your composables to see what can be skipped during recomposition, including using compiler reports to determine what stability is being inferred about your classes. For example, since collection classes like List, Set and Map are not guaranteed to be immutable, using Kotlinx immutable collections instead or annotating your classes as @Immutable or @Stable can allow compose to skip recompositions. There’s lots more in the post.

kotlinx.coroutines 1.6 introduces a set of new testing APIs, and the previous testing APIs are now deprecated. Marton talked about how we’ve migrated some of our own samples to the new APIs, covering a bunch of the necessary work for most Android projects.

AndroidX releases 🚀

Since the last episode of Now in Android, there has been a bunch of interesting stuff released in AndroidX. With so much out there, I’ll just be covering what’s newly stable:

Activity Version 1.5.0
Adds ComponentDialog, a subclass of Dialog that includes an OnBackPressedDispatcher. modular Callback Interfaces in ComponentActivity, and ComponentActivity can now provide a stateless ViewModelProvider.Factory via Lifecycle 2.5.0’s CreationExtras.

Camera Version 1.1.0
Adds video capture use cases through the official camera-video library, YUV to RGB conversion, rotation, multi-window mode support, a CameraState API, JPEG output for OnImageCapturedCallback when Extensions are enabled, ExperimentalCameraFilter and exposure compensation APIs, and much more.

Compose Compiler Version 1.2.0
Supports Kotlin 1.7 and independent Compose library versioning.

Fragment Version 1.5.0
Adds CreationExtras Integration, adds Component Dialog Integration, and refactors Saved Instance State.

Lifecycle Version 2.5.0
Adds getStateFlow() API to SavedStateHandle that returns a StateFlow for monitoring value changes, adds CreationExtras to the ViewModelProvider.Factory subclass via the new overload of create: create(Class<T>, CreationExtras) to simplify gaining access to an Application or SavedStateHandle, and more.

Navigation Version 2.5.0
Provides a stateless ViewModelProvider.Factory via Lifecycle 2.5.0’s CreationExtras, Safe Args has upgraded the Android Gradle Plugin dependency to rely on 7.0.4,and added support for the namespace build.gradle attribute to be used instead of applicationId.

SavedState Version 1.2.0
SavedStateRegistryController allows early attachment of the SavedStateRegistry via performAttach(), you can now retrieve a previously registered SavedStateProvider from a SavedStateRegistry via getSavedStateProvider(), and the library has been rewritten in Kotlin which causes a few source incompatible changes.

Now then… 👋

That’s it for this time, with CTS-D, independent versioning of Compose libraries, Compose stability, custom Compose AnimatedContent, coroutine test migration, Android 13 Intent Filters, and a bunch of stuff from Play and AndroidX, Come back here soon for the next update from the Android developer universe.

--

--

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
Daniel Galpin

Daniel Galpin

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