What’s New in Android 7.0 Nougat
Android 7.0 Nougat signals that the Android OS has reached maturity by switching from a strategy of new, cutting-edge features to incremental updates that focus on improvements to performance, security, and UX.
Developers looking for earth-shattering updates will be disappointed, but make no mistake, there are several changes worthy of attention:
- Performance — Android 7.0 Nougat adds several performance-enhancing features, including:
- Profile guided JIT/AOT Compilation for fast app installs
- Vulcan API support for superior GPU performance
- Project Svelte to optimize background processes.
- Data Usage — Android 7.0 adds features that reduce data usage on devices:
- Data Saver limits the amount of data an app can consume while running in the background
- Doze mode is improved with the ability to automatically limit or turn off data consumption by apps when the device is not in use
- Security — Nougat adds multiple features that make Android OS more secure such as:
- Work Profile gets the ability to add an additional security challenge when a user tries to open a work app
- Direct Boot will allow the OS and enabled apps to run while the device is locked.
- Only system-provided certificates will be trusted. User added Certificate Authorities will no longer be trusted by default.
- APK Signature Scheme v2 is an app-signing scheme that speeds up app installs and offers increased protection from unauthorized changes to APK files.
Join us as we take a look at these features and how they will impact app development for Android 7.0 Nougat.
Profile guided JIT/AOT Compilation
The Android Runtime (ART) uses profile guided compilation to precompile and cache the hot methods (methods that will likely be used first and/or frequently) for optimal gains in performance. These methods are managed by the Ahead Of Time (AOT) compiler.
Each app profile is created only once, eliminating the need for compilation every time the app is run. When the AOT compiles hot methods to native code, it replaces the original code in the app.
The new Just In Time (JIT) compiler might appear to be a throwback to the Dalvik virtual machine, but it really isn’t. In Android Nougat, the JIT compiler works hand-in-hand with the AOT compiler by compiling methods that haven’t already been optimized.
Like AOT compiled code, JIT compiled code replaces the app’s original code. This allows the app to continuously improve performance over time by optimizing all of its methods while it’s being used.
Performance gains will be noticed most in system updates. Before Nougat, an Android device was basically the hostage of system updates that took a long time due to app optimization during the update process. The more apps you had, the longer it took.
JIT compilation eliminates this annoyance by optimizing each app on-the-fly as it is used.
Impact on Developers: Developers who migrate their apps to the Android Nougat can expect a painless experience, with the biggest difference being much faster install times, thanks to JIT compiling.
Vulkan API Support
This one is still a bit over-the-horizon, but the Vulkan API will be a game-changer, especially in Virtual Reality (VR). The Vulkan API is a completely new, close-to-metal API that greatly reduces CPU overhead, delivering a substantial boost in GPU performance for both 3D graphics and GPU computing while using less power.
Add to that top-of-class performance on multithreaded processors and cross-platform compatibility, and it becomes obvious why this will transform both 3D gaming and processor-intensive computing.
Impact on Developers: Developers who begin building apps that support the Vulkan API will be way ahead of the game when the Vulkan API catches on fire in a couple of years.
Project Svelte is all about improving Android device performance by improving how apps run in the background. Poorly managed background processing in apps cause fast battery drain, eat up RAM memory, and adversely affect system performance.
Android 7.0 removes the following three common implicit broadcasts:
Each of these can wake background processes in several apps at once, placing a strain on memory and increasing battery power consumption. Google Developers recommend taking advantage of Android 7.0 and migrate to the JobScheduler and similar APIs.
Impact on Developers: This isn’t a major thing, but the new Project Svelte features will improve app and system performance on Android devices.
Data Saver Mode
In Android 7.0, the Data Saver mode is a new system service that reduces the amount of data consumed by apps on Android devices with a metered data plan. Most users are on some kind of metered connection, with the only notable exception being users who are on unlimited mobile data plans.
The Data Saver mode works by blocking data on apps running in the background. Data usage is also limited in foreground apps by reducing streaming bitrate, lowering image quality, and deferring precaching.
Impact on Developers: Developers who build apps that consume a lot of data and/or stream content should consider including support for Data Saver to reduce excessive data consumption and extend battery life of users’ Android devices.
Doze mode introduces new features that provide the ability to reduce data usage and extend battery life.
Whenever the device’s screen is off, the Doze mode puts it into a light sleep mode where network access is shut off and background app data sync frequency is reduced. When a device is left unused and stationary for a length of time in Doze mode, background app data syncs are stopped, along with scanning for GPS and Wi-Fi networks.
The system, however, is still able to periodically wake the device to perform brief maintenance tasks which allow background apps to access networks and perform deferred jobs and syncs.
Impact on Developers Developers: Those who are following Android recommendations introduced with Doze mode in Android 6.0 Marshmallow should still follow them while working to accommodate new Doze features.
With Android 7.0, the Work Profile features gains the ability to add an additional security challenge when a user tries to open a work app on an Android device. Upon successful completion of the security challenge, the app is unlocked and the user is granted access.
Profile owners, such as IT departments, can set criteria for the security challenge and customize the credentials screen for each authorized app user.
Android devices with a Work Profile provide a toggle for turning the Work mode on and off. When toggled off, the Work mode turns off the user, which in turn disables work apps, background data, and notifications.
Impact on Developers: Developers of enterprise apps that are included in Android Work profiles should make sure their apps support these features on both company issued and personal devices.
Android Nougat advances device security with Direct Boot, a feature that uses file-based encryption (another new feature in Android 7.0) to run apps and system services even when the phone is locked.
To achieve this, Android 7.0 uses a device-encrypted store for specific system data and registered app data. All other system data, user data, and other app data are kept secure using a credential-encrypted store.
When the device first boots, it starts the system in a restricted mode that only allows access to device-encrypted data. App components that need to run on boot need to be registered by setting a flag in the manifest.
Impact on Developers: Developers may need to bite the bullet on apps that require a high level of security and perform the tedious work of explicitly registering each app component in the manifest.
Android 7.0 brings a substantial change to certificate Authorities. Only system-provided certificates will be trusted, while user-added Certificate Authorities (CA) will no longer be trusted by default.
Developers will still be able to use their own CAs, but they will have to refer to the Network Security Configuration documentation to see how user-provided CAs should be trusted.
Impact on Developers: There is a lot more to this than what is covered here. Developers should evaluate whether system-provided certificates or user-added CAs will be the best option. For those who plan to continue with user-added CAs, a careful reading of the Network Security Configuration documentation is recommended.
APK Signature Scheme v2
Android Developers recommends applying this new app signing scheme to all Android apps, although it is not mandated at this time. The APK Signature Scheme v2 offers increased protection from unauthorized changes to APK files while reducing app install times.
There is a bit of a catch, however — if you plan to use APK Signature Scheme v2, be sure to use an archive alignment tool such as zipalign before you sign your app using APK Signature Scheme v2. Otherwise, any changes made to an app will invalidate its signature.
Impact on Developers: Existing apps aren’t affected by this new app-signing scheme. However, new apps should be built to Android recommendations using the APK Signature Scheme v2 to further improve app security.
What Developers Can Expect from Android 7.0 Nougat
Some of the new features and changes introduced in Android Nougat will require a bit of work for developers to implement, but for the most part, nothing too extreme. Most of the new features and improvements found in Android 7.0 Nougat will provide developers few, if any new opportunities through their apps.
The Vulkan AI is something to keep an eye on. Adoption will be slow at first because it’s brand new.
However, once developers realize just how powerful the Vulkan API is, it will catch on fire, driving innovation in both 3D gaming and GPU computing applications.