Random Musings on the Android 13 Developer Beta 1

Each time Google releases a new developer preview, I rummage through the API differences report the high-level overviews, and even the release blog post, to see if there are things that warrant more attention from developers. I try to emphasize mainstream features that any developer might reasonably use, along with things that may not get quite as much attention, because they are buried in the JavaDocs.

Once we get to beta releases, changes to the API surface should start to diminish, and Android 13 Beta 1 is no exception. The API differences report is a fraction of what came in the two developer previews, and even those seemed smaller than in past years.

What Will Break You, Eventually

READ_EXTERNAL_STORAGE effectively is deprecated. Once your targetSdkVersion hits 33 (for most developers, in 2023), you will need to stop requesting READ_EXTERNAL_STORAGE and start requesting one or more of:

  • READ_MEDIA_AUDIO
  • READ_MEDIA_IMAGES
  • READ_MEDIA_VIDEO

Those will affect your ability to read from the standard shared media collections. For other types of content, use the Storage Access Framework.

What May Break You, Sooner

Mishaal Rahman of Esper wrote this week about predictive back navigation.

(IMHO, “predictive” often means “royally screwed up”)

Mishaal goes into a lot of detail, but the upshot is that it appears that Google wants to use animations to help indicate to a user when a system BACK navigation gesture will send the user to the home screen versus doing something else. If you manage your own BACK navigation, such as by overriding onBackPressed() somewhere, you may need to migrate to the new OnBackInvokedDispatcher approach, and you may need to fiddle with android:enableOnBackInvokedCallback if you find that “predictive back navigation” breaks things.

As Mishaal notes, hopefully this Google I|O session will clarify things.

BTW, note that OnBackInvokedDispatcher moved from android.view to android.window in Beta 1.

What Else Changed?

There is an option now to listen to when the keyguard comes and goes. This requires a new SUSBSCRIBE_TO_KEYGUARD_LOCKED_STATE permission. However, this is designed solely for use by ROLE_ASSISTANT apps, so it will not be available to many developers.

Some notable things were deprecated:

The mysterious SPLASH_SCREEN_STYLE_EMPTY value was renamed to SPLASH_SCREEN_STYLE_SOLID_COLOR and appears to give you a way of opting out of having an icon on the mandatory splash screen.

Finally, if you have been using the force-dark options on WebSettings, those were deprecated and replaced by “algorithmic darkening allowed” methods, because those names just roll off the tongue.

What Comes Next?

We are slated to get three more beta releases. I expect there to be few API changes. If that turns out to be true, most likely this will be the last “random musings” post for the Android 13 cycle.

The final release date is murky, as usual, but probably is in the August/September timeframe. Be sure to budget time in May/June (if not sooner) to start playing with Android 13 and testing your app’s compatibility with it.