What Is New in Android 7.0
Android 7.0 Nougat introduced a significant set of features focused on performance, productivity, and security. Here's a quick summary of the key changes.
| Category | Key Changes |
|---|---|
| New Features | Multi-window mode, Direct Reply, Data Saver, VR Mode |
| Performance | JIT compiler, Vulkan API, Background optimizations |
| Security | File-based encryption, Direct Boot, Seamless updates |
| APIs & Development | Multi-locale support, ICU4J APIs, WebView enhancements |
| Accessibility | Variable text scaling, vision settings |
How does multi-window mode change app behavior?
Multi-window allows users to run two apps side-by-side or in picture-in-picture mode. This means your app's activities can be visible but not in focus, requiring you to handle lifecycle changes more gracefully.
You need to declare if your app supports multi-window in the manifest. In practice, you should test your UI in split-screen to ensure it doesn't break or become unusable at smaller sizes.
What are Direct Reply notifications?
Direct Reply lets users respond to messages directly from the notification shade without opening the app. It uses remote input templates to provide a text field and send action.
This matters because it significantly improves user engagement. Implementing it requires using the RemoteInput API and handling the response in your service or broadcast receiver.
How does the new JIT compiler improve performance?
The JIT (Just-In-Time) compiler works alongside ART to speed up app installation and optimize performance while the app runs. It reduces storage space and makes system updates faster.
For developers, this means apps install quicker. The JIT profile data also helps optimize future app launches, making the overall experience smoother for users.
What is File-Based Encryption and Direct Boot?
File-Based Encryption (FBE) allows different files to be encrypted with different keys, which can be unlocked independently. Direct Boot enables apps to run in a limited state before the user unlocks the device.
This is crucial for apps that need to show alarms or notifications immediately after a reboot. You'll need to use Context.createDeviceProtectedStorageContext() for data that requires pre-unlock access.
How do background optimizations affect my app?
Android 7.0 restricts what apps can do in the background to save battery. It removes broadcast receivers for CONNECTIVITY_ACTION and adds Doze on-the-go, which applies battery restrictions even when the device is moving.
You should use JobScheduler or GcmNetworkManager instead of background services for deferred work. This change forces more efficient use of system resources.
FAQ
Do I need to change my app to support multi-window?
Yes, you should test and potentially adjust your layouts. You can also opt-out by setting android:resizeableActivity="false" in the manifest, but this is not recommended as it provides a poor user experience.
How do I implement Direct Reply notifications?
You need to add a RemoteInput to your notification action. The system delivers the user's input to an intent that your app specifies, which you then handle in a service or receiver.
My app uses Connectivity broadcasts. What now?
The CONNECTIVITY_ACTION broadcast is no longer sent to manifest-declared receivers. You must use ConnectivityManager to request a network callback instead.
What is the Vulkan API and should I use it?
Vulkan is a low-overhead, cross-platform API for high-performance 3D graphics. It gives you more direct control over the GPU than OpenGL, but it's primarily for demanding games and graphic applications.
How does Data Saver mode affect network access?
When a user enables Data Saver, the system blocks background data usage. Your app can check if Data Saver is on and request to be whitelisted by the user to bypass this restriction.