Google is always ahead of the curve when it comes to surprising the android users will cool features in the native OS, Android. While Android Pie is slowly making its ground across the globe, Google has already released its next successor, Android Q.
This post is for developers who’re curious about the cool features Android Q will bring and more stuff about the new release. Without further ado, let’s begin.
Android Q Beta version
In 2019, mobile innovation is stronger than ever, with new technologies from 5G to edge-to-edge displays and even foldable screens. Android is right at the center of this innovation cycle, and thanks to the broad ecosystem of partners across billions of devices, Android’s helping push the boundaries of hardware and software bringing new experiences and capabilities to users.
As the mobile ecosystem evolves, Android is focused on helping users take advantage of the latest innovations, while making sure users’ security and privacy are always a top priority. Building on top of efforts like Google Play Protect and runtime permissions, Android Q brings a number of additional privacy and security features for users, as well as enhancements for foldable, new APIs for connectivity, new media codecs and camera capabilities, NNAPI extensions, Vulkan 1.1 support, faster app startup, and more. You can get started with Beta 1 today by enrolling any Pixel device (including the original Pixel and Pixel XL)
Building on top of privacy protections in Android
Android was designed with security and privacy at the center. As Android has matured, Google added a wide range of features to protect users, like file-based encryption, OS controls requiring apps to request permission before accessing sensitive resources, locking down camera/mic background access, lockdown mode, encrypted backups, Google Play Protect(which scans over 50 billion apps a day to identify potentially harmful apps and remove them), and much more. In Android Q, Google made even more enhancements to protect the users. Many of these enhancements are part of the work in Project Strobe.
Giving users more control over the location
With Android Q, the OS helps users have more control over when apps can get the location. As in prior versions of the OS, apps can only get location once the app has asked you for permission, and you have granted it.
One thing that’s particularly sensitive is apps’ access to location while the app is not in use (in the background). Android Q enables users to give apps permission to see their location never, only when the app is in use (running), or all the time (when in the background).
For example, an app asking for a user’s location for food delivery makes sense and the user may want to grant it the ability to do that. But since the app may not need location outside of when it’s currently in use, the user may not want to grant that access. Android Q now offers this greater level of control. Read the developer guide for details on how to adapt your app for this new control. Look for more user-centric improvements to come in upcoming Betas. At the same time, the goal is to be very sensitive to always give developers as much notice and support as possible with these changes.
More privacy protections in Android Q
Beyond changes to location, Google making further updates to ensure transparency, give users control, and secure personal data.
In Android Q, the OS gives users even more control over apps, controlling access to shared files. Users will be able to control apps’ access to the Photos and Videos or the Audio collections via new runtime permissions. For Downloads, apps must use the system file picker, which allows the user to decide which Download files the app can access. For developers, there are changes to how your apps can use shared areas on external storage. Make sure to read the Scoped Storage changes for details.
There also have been reports of disappointment from users (and developers!) get upset when an app unexpectedly jumps into the foreground and takes over focus. To reduce these interruptions, Android Q will prevent apps from launching an Activity while in the background. If your app is in the background and needs to get the user’s attention quickly — such as for incoming calls or alarms — you can use a high-priority notification and provide a full-screen intent. See the documentation for more information.
Limiting access to non-resettable device identifiers, including device IMEI, serial number, and similar identifiers. Read the best practices to help you choose the right identifiers for your use case, and see the details here. Furthermore, randomizing the device’s MAC address when connected to different Wi-Fi networks by default — a setting that was optional in Android 9 Pie.
Google is bringing these changes to you early, so you can have as much time as possible to prepare. I recommend reviewing the detailed docs on the privacy changes and getting started with testing right away.
New ways to engage users
In Android Q, Google is enabling new ways to bring users into your apps and streamlining the experience as they transition from other apps.
Foldable and innovative new screens
Foldable devices have opened up some innovative experiences and use-cases. To help your apps to take advantage of these and other large-screen devices, Google made a number of improvements in Android Q, including changes to onResume and onPause to support multi-resume and notify your app when it has focus. Google has also changed how the resizeableActivitymanifest attribute works, to help you manage how your app is displayed on foldable and large screens. To you get started building and testing on these new devices, the company has been hard at work updating the Android Emulator to support multiple-display type switching — more details coming soon!
When a user wants to share content like a photo with someone in another app, the process should be fast. Android Q is making this quicker and easier with Sharing Shortcuts, which let users jump directly into another app to share content. Developers can publish share targets that launch a specific activity in their apps with content attached, and these are shown to users in the share UI. Because they’re published in advance, the share UI can load instantly when launched.
The Sharing Shortcuts mechanism is similar to how App Shortcuts works, so Google has expanded the ShortcutInfo API to make the integration of both features easier. This new API is also supported in the new ShareTarget AndroidX library. This allows apps to use the new functionality while allowing pre-Q devices to work using Direct Share. You can find an early sample app with source code here.
You can now also show key system settings directly in the context of your app, through a new Settings Panel API, which takes advantage of the Slices to feature that was introduced in Android 9 Pie.
A settings panel is a floating UI that you invoke from your app to show system settings that users might need, such as internet connectivity, NFC, and audio volume. For example, a browser could display a panel with connectivity settings like Airplane Mode, Wi-Fi (including nearby networks), and Mobile Data. There’s no need to leave the app; users can manage settings as needed from the panel. To display a settings panel, just fire an intent with one of the new Settings. Panel actions.
Android Q has extended what your apps can do with Android’s connectivity stack and added new connectivity APIs.
Connectivity permissions, privacy, and security
Most of the APIs for scanning networks already require COARSE location permission, but in Android Q, for Bluetooth, Cellular, and Wi-Fi, increasing the protection around those APIs by requiring the FINE location permission instead. If your app only needs to make peer-to-peer connections or suggest networks, check out the improved Wi-Fi APIs below — they simplify connections and do not require location permission.
In addition to the randomized MAC addresses that Android Q provides when connected to different Wi-Fi networks, Android Q is adding new Wi-Fi standard support, WPA3, and Enhanced Open, to improve security for home and work networks as well as open/public networks.
Improved peer-to-peer and internet connectivity
Android Q refactored the Wi-Fi stack to improve privacy and performance, but also to improve common use-cases like managing IoT devices and suggesting internet connections — without requiring the location permission.
The network connection APIs make it easier to manage IoT devices over local Wi-Fi, for peer-to-peer functions like configuring, downloading, or printing. Apps initiate connection requests indirectly by specifying preferred SSIDs & BSSIDs as WiFiNetworkSpecifiers. The platform handles the Wi-Fi scanning itself and displays matching networks in a Wi-Fi Picker. When the user chooses, the platform sets up the connection automatically.
The network suggestion APIs let apps surface preferred Wi-Fi networks to the user for internet connectivity. Apps initiate connections indirectly by providing a ranked list of networks and credentials as WifiNetworkSuggestions. The platform will seamlessly connect based on past performance when in range of those networks.
Wi-Fi performance mode
You can now request adaptive Wi-Fi in Android Q by enabling high performance and low latency modes. These will be of great benefit where low latency is important to the user experience, such as real-time gaming, active voice calls, and similar use-cases.
To use the new performance modes, all WifiManager.WifiLock.createWifiLock() with
In these modes, the platform works with the device firmware to meet the requirement with the lowest power consumption.
Camera, media, graphics
Dynamic depth format for photos
Many cameras on mobile devices can simulate a narrow depth of field by blurring the foreground or background relative to the subject. They capture depth metadata for various points in the image and apply a static blur to the image, after which they discard the depth metadata.
Starting in Android Q, apps can request a Dynamic Depth image which consists of a JPEG, XMP metadata related to depth related elements, and a depth and confidence map embedded in the same file on devices that advertise support.
Requesting a JPEG + Dynamic Depth image makes it possible for you to offer specialized blurs and bokeh options in your app. You can even use the data to create 3D images or support AR photography use-cases in the future. Google is making Dynamic Depth an open format for the ecosystem, and the company is working with the device-maker partners to make it available across devices running Android Q and later.
New audio and video codecs
Android Q introduces support for the open source video codec AV1. This allows media providers to stream high-quality video content to Android devices using less bandwidth. In addition, Android Q supports audio encoding using Opus – a codec optimized for speech and music streaming, and HDR10+ for high dynamic range video on devices that support it.
The MediaCodecInfo API introduces an easier way to determine the video rendering capabilities of an Android device. For any given codec, you can obtain a list of supported sizes and frame rates using VideoCodecCapabilities.getSupportedPerformancePoints(). This allows you to pick the best quality video content to render on any given device.
Native MIDI API
For apps that perform their audio processing in C++, Android Q introduces a native MIDI API to communicate with MIDI devices through the NDK. This API allows MIDI data to be retrieved inside an audio callback using a non-blocking read, enabling low latency processing of MIDI messages. Give it a try with the sample app and source code here.
ANGLE on Vulkan
To enable more consistency for game and graphics-developers, the company is working towards a standard, updateable OpenGL driver for all devices built on Vulkan. In Android Q we’re adding experimental support for ANGLE on top of Vulkan on Android devices. ANGLE is a graphics abstraction layer designed for high-performance OpenGL compatibility across implementations. Through ANGLE, the many apps and games using OpenGL ES can take advantage of the performance and stability of Vulkan and benefit from a consistent, vendor-independent implementation of ES on Android devices. With Android Q, Google is planning to support OpenGL ES 2.0, with ES 3.0 next on the roadmap.
Google will expand the implementation with more OpenGL functionality, bug fixes, and performance optimizations. See the docs for details on the current ANGLE support in Android, how to use it, and the plans moving forward. You can start testing with the initial support by opting-in through developer options in Settings. Give it a try today!
Google will continue to expand the impact of Vulkan on Android, the implementation of the low-overhead, cross-platform API for high-performance 3D graphics. The goal is to make Vulkan on Android a broadly supported and consistent developer API for graphics. Google is working together with the device manufacturer partners to make Vulkan 1.1 a requirement on all 64-bit devices running Android Q and higher, and a recommendation for all 32-bit devices. Going forward, this will help provide a uniform high-performance graphics API for apps and games to use.
Neural Networks API 1.2
Since introducing the Neural Networks API (NNAPI) in 2017, the company continued to expand the number of operations supported and improve existing functionality. In Android Q, we’ve added 60 new ops including ARGMAX, ARGMIN, quantized LSTM, alongside a range of performance optimizations. This lays the foundation for accelerating a much greater range of models — such as those for object detection and image segmentation. We are working with hardware vendors and popular machine learning frameworks such as TensorFlow to optimize and roll out support for NNAPI 1.2.
Strengthening Android’s Foundations
Android Q introduces several new improvements to the ART runtime which help apps start faster and consume less memory, without requiring any work from developers.
Since Android Nougat, ART has offered Profile Guided Optimization (PGO), which speeds app startup over time by identifying and precompiling frequently executed parts of your code. To help with initial app startup, Google Play is now delivering cloud-based profiles along with APKs. These are anonymized, aggregate ART profiles that let ART pre-compile parts of your app even before it’s run, giving a significant jump-start to the overall optimization process. Cloud-based profiles benefit all apps and they’re already available to devices running Android P and higher.
Google is also continuing to make improvements in ART itself. For example, in Android Q they’ve optimized the Zygote process by starting your app’s process earlier and moving it to a security container, so it’s ready to launch immediately. Android Q will be storing more information in the app’s heap image, such as classes, and using threading to load the image faster. Furthermore, adding Generational Garbage Collection to ART’s Concurrent Copying (CC) Garbage Collector. Generational CC is more efficient as it collects young-generation objects separately, incurring much lower cost as compared to full-heap GC, while still reclaiming a good amount of space. This makes garbage collection overall more efficient in terms of time and CPU, reducing jank and helping apps run better on lower-end devices.
Security for apps
BiometricPrompt is the unified authentication framework to support biometrics at a system level. Android Q will be extending support for passive authentication methods such as face, and adding implicit and explicit authentication flows. In the explicit flow, the user must explicitly confirm the transaction in the TEE during the authentication. The implicit flow is designed for a lighter-weight alternative for transactions with passive authentication. We’ve also improved the fallback for device credentials when needed.
Android Q adds support for TLS 1.3, a major revision to the TLS standard that includes performance benefits and enhanced security. The benchmarks indicate that secure connections can be established as much as 40% faster with TLS 1.3 compared to TLS 1.2. TLS 1.3 is enabled by default for all TLS connections. See the docs for details.
Compatibility through public APIs
Another thing we all care about is ensuring that apps run smoothly as the OS changes and evolves. Apps using non-SDK APIs risk crashes for users and emergency rollouts for developers. Android Q will continue the long-term effort begun in Android P to move apps toward only using public APIs.
– Android developer’s blog said
In Android Q, Google is restricting access to more non-SDK interfaces and asking you to use the public equivalents instead. To help you make the transition and prevent your apps from breaking, they’re enabling the restrictions only when your app is targeting Android Q. Google will continue adding public alternative APIs based on your requests; in cases where there is no public API that meets your use case, report that to the issue tracker.
It’s important to test your apps for uses of non-SDK interfaces. Using the StrictMode method detectNonSdkApiUsage() to warn when your app accesses non-SDK APIs via reflection or JNI. Even if the APIs are exempted (grey-listed) at this time, it’s best to plan for the future and eliminate their use to reduce compatibility issues. For more details on the restrictions in Android Q, see the developer guide.
Google is expanding its efforts to have all apps take full advantage of the security and performance features in the latest version of Android. Later this year, Google Play will require you to set your app’s targetSdkVersion to 28 (Android 9 Pie) in new apps and updates. In line with these changes, Android Q will warn users with a dialog when they first run an app that targets a platform earlier than API level 23 (Android Marshmallow). Here’s a checklist of resources to help you migrate your app.
The company is also moving the ecosystem toward readiness for 64-bit devices. Later this year, Google Play will require 64-bit support in all apps. If your app uses native SDKs or libraries, keep in mind that you’ll need to provide 64-bit compliant versions of those SDKs or libraries. See the developer guide for details on how to get ready.
Get started with Android Q Beta
With important privacy features that are likely to affect your apps, it is recommended getting started with testing right away. In particular, you’ll want to enable and test with Android Q storage changes, new location permission states, restrictions on background app launch, and restrictions on device identifiers. See the privacy documentation for details.
To get started, just install your current app from Google Play onto a device or Android Virtual Device running Android Q Beta and work through the user flows. The app should run and look great, and handle the Android Q behavior changes for all apps properly. If you find issues, it’s recommended to fix them in the current app, without changing your targeting level. Take a look at the migration guide for steps and a recommended timeline.
Next, update your app’s targetSdkVersion to ‘Q’ as soon as possible. This lets you test your app with all of the privacy and security features in Android Q, as well as any other behavior changes for apps targeting Q.
Explore the new features and APIs
When you’re ready, dive into Android Q and learn about the new features and APIs you can use in your apps. Take a look at the API diff report, the Android Q Beta API reference, and developer guides as a starting point. Also, on the Android Q Beta developer site, you’ll find release notes and support resources for reporting issues.
To build with Android Q, download the Android Q Beta SDK and tools into Android Studio 3.3 or higher, and follow these instructions to configure your environment. If you want the latest fixes for Android Q related changes, using Android Studio 3.5 or higher is highly recommended.
How do I get Android Q Beta?
It’s easy – you can enroll here to get Android Q Beta updates over-the-air, on any Pixel device (and this year Google is supporting all three generations of Pixel — Pixel 3, Pixel 2, and even the original Pixel!). Downloadable system images for those devices are also available. If you don’t have a Pixel device, you can use the Android Emulator, and download the latest emulator system images via the SDK Manager in Android Studio.
It is planned to update the preview system images and SDK regularly throughout the preview. You’ll have more features to test as the Beta program moves forward.