What Is New in Android 9
Android 9 Pie introduced a smarter, simpler, and more tailored user experience with significant under-the-hood improvements for developers.
| Category | Key Changes |
|---|---|
| New Features | AI-powered features (App Actions, Slices), Display cutout support, Multi-camera API, ImageDecoder |
| Privacy & Security | BiometricPrompt API, Hardware Security Module, TLS by default, Restricted sensor access |
| Performance | ART performance improvements, Battery management with Adaptive Battery |
| Connectivity & Media | HDR VP9 Video, HEIF image compression, DNS over TLS |
| Deprecated | Apache HTTP Client, Shared memory API |
How did Android 9 improve privacy and security?
Android 9 locked down the platform with several key security enhancements. A unified BiometricPrompt API replaced the old fingerprint dialog, providing a consistent user experience for all biometric authentication types. The OS also began enforcing TLS by default for all app traffic, preventing accidental cleartext communication.
Apps now have restricted access to sensors like mic and camera when running in the background, enhancing user privacy. For sensitive operations, the Android Protected Confirmation and the availability of a dedicated Hardware Security Module (StrongBox) provided a new level of hardware-backed security.
What are App Actions and Slices?
App Actions and Slices are AI-driven features that help users get things done faster. App Actions predict what a user wants to do next and surface your app's functionality in places like the Launcher and Google Play. They use intents to deep-link into specific activities within your app.
Slices are interactive snippets of your app that can be embedded in Google Search and other surfaces. A Slice can show real-time, rich content and handle user interactions without the user needing to fully open the app. In practice, these features required developers to add metadata and implement new APIs to make their apps more discoverable and actionable.
What camera enhancements were introduced?
The Multi-camera API was a major addition, allowing apps to simultaneously access streams from multiple physical cameras on devices that supported them. This enabled advanced features like seamless zoom, bokeh, and stereo vision. The new ImageDecoder API provided a modernized way to decode images, offering advantages over BitmapFactory like built-in post-processing and support for HEIF format.
Support for display cutouts (notches) was also formalized, giving developers a standard way to manage how their UI flows around these hardware features, ensuring a consistent look across different devices.
How did Android 9 boost performance and battery life?
Under the hood, the Android Runtime (ART) saw significant performance gains. The runtime executed more efficient ahead-of-time (AOT) compilation and reduced app size by compressing compiled code. For users, the most noticeable improvement was Adaptive Battery, which used machine learning to prioritize system resources for the apps the user cares about most, limiting battery drain from rarely used apps.
FAQ
Is the Apache HTTP client library still available?
No, it was removed from the bootclasspath in Android 9. You must add useLibrary 'org.apache.http.legacy' to your android block in build.gradle or migrate to the HttpURLConnection class.
My app's network requests are failing on Android 9. Why?
Android 9 enables TLS by default and cleartext traffic is blocked. You need to either ensure all your connections use HTTPS or explicitly allow cleartext for specific domains by configuring your network security policy.
How do I support devices with a notch?
Use the layoutInDisplayCutoutMode window attribute. Set it to LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES to allow content to render into the cutout area, or LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER to avoid it.
What is the replacement for the deprecated shared memory API?
The Ashmem API was deprecated. You should use the Android SharedMemory API instead, which provides similar functionality with a more modern and secure implementation.
Can I still use the fingerprint manager API?
The FingerprintManager class is deprecated. You must migrate to the new BiometricPrompt API, which offers a standardized UI and supports all types of biometric authentication, not just fingerprints.