Random Musings on the Android 13 Developer Beta 1
Each time Google releases a new developer preview, I rummage throughthe API differences reportthe 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 developermight reasonably use, along with things that may notget 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 fractionof what came in the two developer previews, and even those seemed smaller than in pastyears.
What Will Break You, EventuallyREAD_EXTERNAL_STORAGE effectively is deprecated. Once your targetSdkVersion hits32 (for most developers, in 2023), you will need to stop requesting READ_EXTERNAL_STORAGEand start requesting one or more of:
READ_MEDIA_AUDIO READ_MEDIA_IMAGES READ_MEDIA_VIDEOThose will affect your ability to read from the standard shared media collections. For othertypes of content, use the Storage Access Framework.
What May Break You, SoonerMishaal 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 indicateto a user when a system BACK navigation gesture will send the user to the home screen versusdoing something else. If you manage your own BACK navigation, such as by overridingonBackPressed() somewhere, you may need to migrate to the new OnBackInvokedDispatcherapproach, and you may need to fiddle with android:enableOnBackInvokedCallbackif you find that ���predictive back navigation��� breaks things.
As Mishaal notes, hopefully this Google I|O sessionwill clarify things.
BTW, note that OnBackInvokedDispatcher moved from android.view to android.windowin 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_STATEpermission. However, this is designed solely for use by ROLE_ASSISTANT apps, so itwill not be available to many developers.
Some notable things were deprecated:
ACQUIRE_CAUSES_WAKEUP, for use with WakeLock
get() on BaseBundle and subclasses
Several methods on Bundle, whereyou now need to add a Class parameter to the end of the parameter list
The mysterious SPLASH_SCREEN_STYLE_EMPTY value wasrenamed to SPLASH_SCREEN_STYLE_SOLID_COLORand 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 weredeprecated 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/Septembertimeframe. Be sure to budget time in May/June (if not sooner) to start playing with Android 13 andtesting your app���s compatibility with it, perhaps in tandem with raising your targetSdkVersion to 31.


