Android 11 is here, and with it, a whole bunch of changes from Android 10. And those changes mean that developers are going to need to update their apps to take advantage of everything Android 11 has to offer (and everything it restricts).
This article goes over the more important API and feature changes and additions in Android 11. We have a separate article on the more user-focused features that you can also check out. Now, let's get started!
Device Controls
One of the bigger features introduced in Android 11 is known as Device Controls. Device Controls' intended purpose is to make controlling your smart devices easier. Open the power menu, and you'll be able to see and quickly interact with any connected smart devices you have. This isn't a closed feature, either. Any developer can make their own widgets for Device Controls.
Currently, there are 5 different widget types available: Toggle, which is a simple status indicator with on/off functionality; Range, which can be used to adjust some value between 0-100%; Toggle with Slider, which combines the functionality of Toggle and Range; Stateless, which is a simple button with no status indicators; and Temperature Panel, which allows you to view and control the temperature settings of a thermostat.

While it's clear that these widgets are meant to be used to things like lights and window blinds, there's certainly a potential to "abuse" them for more functionality. If you want to get started developing your own Device Controls widget, check out Google's docs. If you want to learn more about why Device Controls might be useful, check out our editorial.
Media Controls
Controlling media in Android 11 is pretty interesting. Instead of the standard playback notification, you can have your media controls show up in the quick settings panel. This part of the panel will also show up to 5 total media "sessions," allowing the user to swipe through and easily resume playback from other apps and devices. It seems that there can even be multiple sessions from a single app.


Implementing this isn't fully automatic, though. Your app needs to support the new Media Controls. Check out Google's documentation and our article for more information.
Screen Recording
At long last, Android has built-in screen recording. In Android 11, recording your screen is as simple as adding a quick settings tile and tapping it. Before you start recording, you can choose whether you want to record audio from the microphone and if you want to show touches on-screen.

This has some implications for developers, though. There are an absolute ton of screen recording apps on the market. While Android 11 doesn't break their functionality, it does mean that third-party screen recorders will need to provide some compelling features if they want to be used instead of what's built into Android.
One-Time & Auto-Revoking Permissions
Google has been concentrating a lot on user privacy features in Android lately, and they haven't stopped with Android 11. This release has two very important changes to the runtime (or "dangerous") permissions model.
In previous versions of Android, if your app needed a dangerous-level permission, it would request access from the user, and that was pretty much it. Your app would keep that permission until it was uninstalled, its data was cleared, or the user manually revoked it.
Android 11, however, no longer has this guarantee. Now, when a user is prompted to grant a permission, they'll have the option to grant it "only this time." The permission will be granted to the app only as long as it's in the foreground. Here's how Google describes its behavior:
"While your app's activity is visible, your app can access the data.
If the user brings your app to the background, your app can continue to access the data for a short period of time.
If you launch a foreground service while the activity is visible, and the user then moves your app to the background, your app can continue to access the data until that foreground service stops.
If the user revokes the one-time permission, such as in system settings, your app cannot access the data, regardless of whether you launched a foreground service. As with any permission, if the user revokes your app's one-time permission, your app's process terminates."
Obviously, there are some pretty major implications for developers here. Since a permission revocation acts like a force-stop, it can cause things like alarms and jobs to fail. According to the Commonsware blog, that "short period of time" your app can work in the background is only about a minute. So if your app has something that relies on precise wakeups, you're going to need to recommend that the user not use the one-time permission option for your app.
One-time permissions aren't the only thing added in Android 11, though. If Android detects that you haven't used an app for a while, it'll automatically revoke all granted permissions. This is a nice privacy feature in theory, but again, it has some serious implications, especially for apps whose primary purpose is to run and collect data in the background (like battery trackers).


Messaging App Notifications
Android 11 is apparently very "people-focused." While that's a bit of a vague term, at least part of it involves a better messaging experience, with properly-marked message notifications appearing in their own category at the top of the notification center. It also means supporting Android's Bubbles feature, which is similar to Facebook Messenger's Chat Heads.


If you're interested in implementing the new "people-focused" messaging features in your app, head on over to Google's documentation.
File Managers and Scoped Storage
Scoped Storage is a mess. There, I said it. As a feature, it's confusing enough for developers, and Google is only making things worse with its weird semi-rollouts and policies.
Previously, in Android 10, developers had the ability to opt-out of using Scoped Storage with the requestLegacyExternalStorage flag. This is still possible in Android 11 if your app is still targeting Android 10. But as soon as you target Android 11, this flag is ignored.
If you're working on migrating your data model to support Scoped Storage, you can use the preserveLegacyExternalStorage flag. This will allow your app to continue accessing external storage as long as the user upgraded to the version containing this flag. If the user clears the app's data, reinstalls, or is a new user, this flag won't have any effect.
Google does at least partially recognize the importance of full user-space filesystem access, though. There is a new permission (MANAGE_EXTERNAL_STORAGE) to allow you to have mostly-full access again. However, this permission is not allowed in apps published to the Play Store until sometime in 2021. If you have a file manager or antivirus app on the Play Store, you'll need to hold off on targeting API 30 for now.
These aren't the only changes to Scoped Storage, though. The data and obb directories under /sdcard/Android/ are no longer accessible under any circumstances, even with the MANAGE_EXTERNAL_STORAGE permission. You also aren't able to use ACTION_OPEN_DOCUMENT_TREE to target the root of any "reliable" storage or the Download folder anymore. What constitutes as "reliable" storage is up to the manufacturer of the device, but it's safe to say internal and adopted storage probably both count.

Background Location
If your app needs access to location data in the background, the process is now more involved. Android 10 added the ability to only allow an app access to location data when it's in the foreground or to allow it all the time. Android 11 further separates these options.
Now, instead of a user choosing one or the other, they have to first allow access to location while using the app, and then go to Settings to allow background access. If your app targets Android 11 (API 30), and you need access to location data in the background, you'll need to update your permission flow to keep this into account. Take a look at Google's documentation for instructions on implementing this.
BiometricPrompt API
As authentication methods like fingerprint readers and face recognition become more widespread, it's important to be able to specify what forms of authentication you want to allow. A new API in Android 11 will let you specify the "strength" of the biometric authentication you want to allow.
Identity Credential API
With our payment methods going virtual through apps like Google Pay and Samsung Pay, it's only natural that there would be a push to make various forms of identity virtual, as well. Android 11 is working on functionality to properly support virtual identities. The native API is there in Android 11, but Google is also working on a Jetpack library for Android versions as far back as Android 7.0 Nougat.
5G APIs
"Yay! 5G!" – said no one ever.
Android 11 has some new APIs to help app developers learn more about the current 5G network that the device is connected to. You can do things like check the type of 5G (5Ge, 5G sub6, 5G mmW), check if it's metered, and even get a value for the estimated bandwidth of the connection. On top of that, if you don't have a 5G-capable device (or 5G service in your area), the Android emulator is getting support for virtual 5G, so you'll be able to properly test how your app responds to the different network modes.