More Random Musings on R DP2!
So, here are some more random musings, based on that API differences report, and building upon yesterday’s original set of R DP2 musings.
Things That Show How Android Is In Control
As XDA-Developers mentioned a few hours ago,
there is a new API for adding “quick controls” to the menu we get on a long-press of the POWER
button. Apps can implement a
to advertise options for this “quick controls” area. This appears to work a bit
TileService does for adding tiles to the notification shade. The
available types of controls are defined as constants on a
class, and the candidates are mostly appliances and similar sorts of household
items… and, apparently, a pergola.
However, I feel quite confident that enterprising developers will find ways
to use this for ‘device types’ that are somewhat broader in nature.
Things That Share
In Android 10, we got
I blew past it, in part because I couldn’t figure out what it was for our how we
would really use it.
In R DP2, we now have
Its JavaDocs have a very interesting sentence:
The primary usage of this class is to embed a View hierarchy from one process in to another.
The implication is that we might now have something that developers have been asking for since the very early days of Android: the ability to embed the UI of one app in another. Whether that is the intended purpose or not remains to be seen, as all of this is still rather under-documented.
Things That Affect Security
There is a new
API for developers of VPN clients.
Verify the details of an
InputEventthat came from the system. If the event did not come from the system, or its details could not be verified, then this will return null.
It is unclear what the scenarios are where the
InputEvent would not come from “the system”,
in part because there is no real definition here of “the system”. However, if you
have a highly-secure input scenario (e.g., passcode for a banking app), this
may be worth investigating further.
Things That Are Getting Massaged
If you have been using various ways of implementing full-screen UIs, such
setSystemUiVisibility(), your current API calls may now be deprecated.
That is moving to
ChooserTargetService that were the original approach
for direct-share targets are now deprecated in favor of Android 10’s
Sharing Shortcuts API.
What Happens Next?
The collapse of Google I/O does start to raise questions about Android R’s rollout. It would not surprise me if things get delayed, both at the level of the developer previews and betas and at the level of a final release. After all, Google has to do what everyone else is doing: try to get stuff done in the face of a pandemic.
However, eventually, the sun will shine again, SARS-CoV-2 will have reduced impact, and Android R will ship. Between now and then, I will write and blog what I can on what Android R means for us developers.
Interested in Jetpack Compose?
jetc.dev has a weekly newsletter of the latest articles, samples, and other details of Compose development!