The final release for Android 11, Google’s latest version of their mobile operating system is getting closer to launch. Android 11's third beta is now out and Google says this will be the last release before the final version arrives in early September.
The latest beta update is largely aimed at fixing bugs rather than ushering in new features. So if you're an adventurous Android user or developer with a supported phone, you may be tempted to try out Android 11 for yourself before the final release arrives.
Before you test out the Android 11 beta yourself, here's what we know so far about the new features, along with what we’re doing at BitBakery to prepare for the release:
Android 11 features and APIs: What’s new and improved
Android 11 introduces great new features and API’s focusing on people, controls privacy and more. Based on our experience exploring the latest beta release, here are a few that stand out to us:
Device and media controls
Android 11 includes a new API that developers can use to expose controls for connected, external devices. This allows users to quickly view and control external devices such as lights, thermostats and cameras from the Android power menu. Device aggregators such as Google Home and third-party vendor apps can provide devices for display in this space.
The update also affects how media controls are displayed. Sessions from multiple apps are arranged in a swipeable carousel which includes streams playing locally on the phone, remote streams, such as those detected on external devices or cast sessions, and previous, resumable sessions in the order they were last played. Now, users can restart previous sessions from the carousel without having to start the app!
Android 11 provides several APIs to support waterfall displays which wrap around the edge of the device. These displays are treated as a variant of displays with display cutouts. The existing methods now return the safe inset to avoid waterfall areas as well as cutouts which makes responding to the device posture more reliable.
Android 11 is meant to be people focused and makes a number of improvements to the way conversations are handled. Conversations are real-time, bidirectional communications between two or more people so now Chat Bubbles are available to developers to help surface conversations across the system.
These will keep ongoing conversations in a handy container that you can tap to access from anywhere on your phone. A Bubbles API appeared in an early Android 11 preview to give third-party apps access to this feature.
If you've used Facebook Messenger and experienced that app's reliance on Chat Heads, you've got a pretty good idea of what to expect with Android 11.
New safeguards have been developed to protect user privacy that developers will need to support in their apps:
Scoped storage enforcement
Apps that target Android 11 as well as Android 10 are subject to scoped storage behaviours. This improves security as it allows developers to have their own space on the storage of your device that is private without asking for any specific permissions when first run.
Additionally, when you grant this permission for an app it gives access to the entire external storage where users save things like photos, private documents, videos and other potentially sensitive files. With Scoped Storage enforced, apps only can see their own data folders plus certain media types like music files using other storage APIs.
Android 11 continues to fine-tune permissions, adding an "Only this time" option that will give apps momentary access to things like location tracking, the microphone and the camera. It's a level of privacy that iOS users already enjoy so it's good to see that come to Android.
This update affects any app that targets any version and request location, microphone or camera permissions. When preparing for the update, check that your app has a permission before attempting to access data that's guarded by that permission and make sure to follow best practices for requesting permissions.
Another great update for privacy is that if users haven't interacted with an app for a few months on Android 11, the system auto-resets the app's sensitive permissions.
So if you have an app that uses your location, but you haven’t used it in a while, it’ll automatically revoke those permissions and make you opt in again when you do eventually run the app. This affects apps that target Android 11 and perform most of their work in the background. To update this, ask the user to prevent the system from resetting your app's permissions.
Behaviour changes for apps
The new update brings system changes that may affect your app when it’s running on Android 11. Here’s what you should know:
Performance and debugging
Android 11 offers debugging support for apps to identify potential JobScheduler API invocations that have exceeded certain rate limits. Developers can use this facility to identify potential performance issues.
Previously, Android 10 introduced fdsan (file descriptor sanitizer) which detects mishandling of file descriptor ownership. The default mode for fdsan is changing in Android 11 which now aborts upon detecting an error instead of the previous behavior to log a warning and continue. If you're seeing crashes due to fdsan in your application, refer to the fdsan documentation.
In previous versions of Android, the framework dispatched touch events to widgets that didn't handle click-based accessibility actions properly. Typically, these views handle touch events directly instead of registering a click listener.
Now, to create more consistent behavior in apps that correctly define accessibility actions, Android 11 never dispatches touch events. Instead, the system relies entirely on the click-based accessibility actions. This change affects the behavior of screen readers.
Interaction with other apps
If your app shares a content URI with another app, the intent must grant URI access permissions by setting at least one of the following intent flags. That way, if the other app targets Android 11, it can still access the content URI. Your app must include the intent flags even when the content URI is associated with a content provider that your app doesn't own.
If your app owns the content provider that's associated with the content URI, verify that the content provider isn't exported. We already recommend this security best practice.
The official Android 11 launch is anticipated to come out in early September. In the meantime, developers should be finishing testing and publishing compatible features as soon as possible.
Photo by Angela Compagnone on Unsplash