Random Musings on the Android 15 Developer Preview 2
When Google releases a brand new developer preview, I rummage via
the API variations report
(even when Google doesn’t appear to hyperlink to them 🙃),
the high-level overviews,
and even the discharge weblog publish,
to see if there are issues that warrant extra consideration from
builders. I attempt to emphasize mainstream options that any developer
would possibly fairly use, together with issues that won’t
get fairly as a lot consideration, as a result of they’re buried within the JavaDocs.
This launch is way bigger than was the earlier developer preview. It feels
like Developer Preview 1 was “low-hanging fruit”, to offer builders a further month
or so on the main adjustments for Android 15.
What Would possibly Break You This 12 months
In case your app is force-stopped, all pending intents are cancelled.
This transformation impacts all apps, not simply these focusing on Android 15. I assumed this
was already the habits, however apparently it isn’t. For some gadgets that ship
with “activity managers” that apply force-stop logic as a substitute of solely terminating app
processes, this transformation might actually impression your customers. Happily, at the very least,
you’ll now get ACTION_BOOT_COMPLETED broadcast to your app so you’ll be able to re-establish
something that was canceled. Nonetheless, there is also a brand new
ACTION_PACKAGE_UNSTOPPED
broadcast that you simply would possibly take into account. PackageManager additionally now has an isPackageStopped()
perform, so exterior events can see in case your app was force-stopped.
FINGERPRINT_SERVICE was faraway from Context,
additional impacting the already-deprecated FingerprintManager.
What Would possibly Break You Subsequent 12 months
When you goal Android 15, you’ll
not be allowed to start out some forms of foreground providers at boot time.
I can see this inflicting issues for a good variety of apps.
Additionally, when you goal Android 15, in case your app helps Arabic, Lao, Myanmar, Tamil, Gujarati, Kannada, Malayalam, Odia, Telugu or Thai,
then Android will use a taller font by default.
This may increasingly trigger UI glitches, reminiscent of textual content being lower off because of lack of enough
vertical house.
What I Like of the Outstanding Adjustments
Google taking PDF rendering critically
is a pleasant enchancment. PdfRenderer was designed
to be used in print previews, however builders have been attempting to make use of it for arbitrary PDFs,
with various outcomes. And since many builders actually don’t need to use the person’s
most well-liked PDF reader, we have been caught with varied workarounds.
The truth that the improved PdfRenderer is being backported and apparently can be
wrapped in a Jetpack library additionally helps an incredible deal.
Help for deeplink filtering on question parameters and fragments
is one thing that builders have been requesting for a number of years, so it’s good
that we’re getting it, even when that isn’t one thing that may be backported.
Granular line-break controls,
so we are able to hold titles contiguous, is a long-awaited textual content rendering enchancment.
Equally, builders have been asking for discover out
why the app was began for
fairly a while.
Display screen recording detection
gives a pleasant center floor between being oblivious to display screen recording and utilizing
FLAG_SECURE to dam it solely. Word that you simply want
a brand new regular permission
to allow this functionality.
What Makes Me Go “Hmmmmm…”
Assets now has a registerResourcePaths() methodology.
“This can accumulate the bundle sources’ paths from its ApplicationInfo and add them to all present and future contexts whereas the appliance is operating”.
Getting and setting the system bar colours is now deprecated.
What Else You Would possibly Have Missed
Your manifest elements (actions, providers, receivers, and suppliers) could be
protected with android:systemUserOnly=”true”.
That is alleged to restrict that element to at most one occasion, and that occasion
can solely be interacted with by the system person. My hope is that we are able to use this for
particular locations the place we need to plug into the framework however need to preclude arbitrary
different apps from attempting to make use of the element.
By DevicePolicyManager, eligible apps can mandate “content material safety”
or can enable person selection.
On this case, “content material safety” means “scanning for misleading apps”. Equally,
a tool proprietor or coverage proprietor can block NFC for sure customers.
For app shops, ACTION_UNARCHIVE_PACKAGE
would possibly show fascinating. Additionally, PackageInstaller now has
a brand new set of APIs associated to archiving apps.
There are new KeyEvent key code values
for devoted emoji picker and screenshot keys.
We will now restrict drag-and-drop to be simply inside our app, even when we now have a number of home windows.
We will additionally specify an exercise IntentSender to make use of for unhandled drops.
— Mar 23, 2024