Image for post
Image for post
Illustration by Virginia Poltrack

Now in Android #34

MAD Skills MotionLayout, Material Components, KSP, AndroidX, Coroutines and Intents articles, App Security talk, and App Quality and Education announcements

Manuel Vivo
Feb 19 · 5 min read

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

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

Video

Podcast

Click on the link below, or just subscribe to the podcast in your favorite client app.

MAD Skills: Motion Layout

The series on MotionLayout is coming to an end. In the fourth episode, Sean McQuillan explains how to build a collapsible toolbar using Motion Layout, which is a common place where this API shines. Along the way, you’ll learn how to animate custom attributes using MotionLayout.

And the final episode is, no surprise here, a live Q&A with Motion Layout experts on the developer relations and engineering teams. Tune in and ask questions if you’re reading this before it happens.

If you missed any of the previous episodes, be sure to check out the MotionLayout MAD Skills series playlist.

Psst… Spoiler alert, the next MAD Skills series is about WorkManager! Don’t tell anyone 🤐

Library Releases

Material Design Components

Image for post
Image for post
New MaterialTimePicker in material-components-android 1.3.0

The material-components-android library released version 1.3.0 in stable! It comes with new Material components such as MaterialTimePicker and ProgressIndicator. Other updates include internationalisation and localisation of strings inside some components like dialogs, as well as exposing the BadgeUtils class as public.

See all the changes in the release notes.

Kotlin Symbol Processing

Kotlin Symbol Processing (KSP), the tool for building lightweight compiler plugins in Kotlin, is now in alpha. If you are familiar with annotation processors, KSP offers similar functionality to KAPT, but it’s up to 2x faster and is being developed with Kotlin multiplatform in mind.

If you’re an author of a library that uses annotation processing, see the blog post for information on how you can make your library KSP-compatible.

Android X

Among the many recent incremental releases of various AndroidX libraries were the following stable releases:

Activity 1.2.0: This version marks the first stable release of the Activity Result APIs that bring type safety and easier testing to the startActivityForResult and requestPermissions flows. Furthermore, ComponentActivity implements the ContextAware API to give you a hook before super.onCreate is called.

Fragment 1.3.0: A lot changed in this version! Notably, it brings a new State Manager which involved a significant rewrite of the internals of FragmentManager. It also adds support for Activity 1.2.0, adds new Fragment Result APIs, and considerably improves FragmentScenario from the fragment-testing artifact.

Lifecycle 2.3.0: This version adds SavedStateHandle support for non-parcelable classes, Lifecycle State and Event helpers, and other niceties like the withStateAtLeast suspend functions that execute a block of code when the lifecycle changes to the given State.

Apart from the stable releases, Paging 3 reached its first beta release and this is worth a shout-out! Paging 3 has been a huge rewrite in Kotlin that embraces coroutines at a fundamental level. Those APIs have reached API stability with beta01.

Articles & Talks

Bridging the gap between coroutines, threads, and concurrency problems

Image for post
Image for post

I wrote this article to demystify how coroutines are actually executed on the Android runtime. Since coroutines in Android use the threading model as defined by the Java programming language, you need to watch out for concurrency issues in your code.

Adapting your apps for Android 11 privacy changes

Privacy continues to be a priority for Android, because protecting user’s private data, and transparency around app usage of that data, is increasingly important. Fred Chung’s talk covers some user-facing changes but it’s primarily focused on developers: new APIs, behavior changes, and testing. It includes changes to permissions like the one-time permission option, storage, package visibility, tooling to help identify private data access, and more.

Android Nesting Intents

Image for post
Image for post

Nicole Borrelli explains why your app should use PendingIntents instead of Intents for implementing inter-app callbacks. Spoilers: not doing so could leave your app vulnerable.

App quality

Application quality matters to everyone. The new App Quality page in our developer site helps you keep up-to-date with key aspects of app quality and provides related resources on how to achieve and maintain high quality. The core app quality checklist will help you assess your app in terms of visual experience, functionality, performance & stability, privacy & security, and Google Play. Some developers found it helpful to share this with their design and QA teams to align expectations.

Going forward, we will regularly update this list to keep it up-to-date as well as expanding this to other form factors such as tablets and WearOS.

Education

We want to make Android development accessible to more people! A new curriculum for Android Development with Kotlin is available for educators to teach Android in a classroom setting. It includes many materials to give you everything you need, from lecture slides to hands-on codelabs.

For people who like to learn in peer groups, the Android Study Jams program is now available to all developers. This content enables a group of people to come together and learn Android at their own pace through an online curriculum.

Now then…

That’s it for this time. So go MAD for more MotionLayout content! Check out the latest KSP alpha release, and material components and AndroidX stable releases! Read new articles on coroutines and nesting intents, and watch the latest Android 11 Privacy changes video. See the new resources on App Quality, Education, 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