The Complete Magazine on Open Source

Comprehensive feature set of Android N available to developers

, / 3182 1

Android N Preview

Android N is still in active development, and the N Developer Preview is now open. Here are some new features that are primarily reserved for developers who can leverage the same to introduce some interesting ideas for the platform.

Multi-window support

In Android N, one can avail the much-requested multitasking feature that emerged as the multi-window support. One can pop-open two different apps on the screen at once. Two apps can be run side-by-side in the splitscreen mode. The apps can be resized with the help of the slider.

Apps can also be inserted in a picture-in-picture mode, allowing them to display content at the time of browsing or interaction. Multi-window support gives new ways to engage users especially in tablets and huge screen devices. Additionally, one can conveniently drag content to the app and even remove something anytime.

Notification enhancements

In Android N, notifications are redesigned for easier access and quick usage. The changes include:

  • Updated notification templates for more emphasis on image and avatar. Developers can take advantage of templates with only a few adjustments in their code.
  • Customise more user interface labels with notifications using the MessagingStyle class wherein the message, title, and content view can be configured quickly.
  • One can group messages together, regarding the topic and group. Also, one can take actions or implement notifications for Android Wear.
  • For real-time communication apps, inline replies are supported for quick response to SMS or text message.
  • Two new APIs enable customisations of notification headers and actions, especially with custom views in notifications.

Profile-guided JIT/AOT compilation

The Just in Time (JIT) compiler with code profiling option to ART helps improve the performance of apps as they run. It complements ART’s Ahead of Time (AOT) compiler and boosts runtime performance. Further, the compiler reduces storage space and enhances app updates and system updates. The compilation lets ART manage AOT/JIT compilation for the app, based on their actual usage and device conditions. It also maintains a profile of hot methods and caches those methods for best performance. Other parts of the app are left without compilation until they are used.

The profile-guided compilation also reduces an app’s RAM footprint and the associated binaries. This feature is important for all types of low-memory devices. ART manages profile-guided compilation with minimum impact on device battery.

Battery saver Doze

Doze saves battery while on the go. If the screen is off and the device is unplugged, Doze applies some CPU and network restrictions on apps so that the users can save on battery life even when their devices are kept away or placed in the pockets.

Doze restricts network access and even pauses the sync operations. Applications are allowed network access during the brief maintenance cycles when all deferred jobs are executed. Plugging in the device gets the device to its normal state.

Doze applies full CPU and network restrictions on PowerManager when the device is stationary.

Project Svelte with several background optimisations

Project Svelte is used to reduce RAM use by system and apps in Android devices within the ecosystem. Project Svelte can optimise the apps running in the background.

Good background processing makes the apps work immediately and quickly and with context-aware precision. If not optimised, it consumes extra RAM (and battery) and even affects system performance on the whole.

JobScheduler has been used extensively to perform background work for users. Apps could schedule jobs while keeping the memory, power, and connectivity optimised. JobScheduler offers ample control and simplicity for all apps. GCMNetworkManager is another good option for handling background services and features good job scheduling options with compatibility across several Android versions. These schedulers and optimisers will all be in use with Android N.

Three implicit broadcasts are removed — CONNECTIVITY_ACTION, ACTION_NEW_PICTURE, and ACTION_NEW_VIDEO — since they are known to strain memory and battery. Developers can use the N Developer Preview to migrate to JobScheduler instead of using these implicit broadcasts.

SurfaceView for better battery performance

SurfaceView class provides better battery performance with its contemporary movement, better than TextureView in certain cases, especially when rendering video or 3D content, apps with scrolling and animated video position use less power with SurfaceView than with TextureView.

The SurfaceView class enables more battery-efficient compositions and even makes fewer intermediate copies than TextureView does. The content position is updated synchronously with app content. The simple translations or scales of video playing in SurfaceView do not create black bars as it moves. One can save power by using SurfaceView instead of using TextureView.

Data Saver mode

Android N includes the Data Saver mode, which will help reduce cellular data use by apps, especially near the end of the billing cycle, or even in prepaid data packs. It gives users control over how apps make use of cellular data and lets developers deliver service when Data Saver is on.
The system blocks data usage when the mode is enabled and signals apps to use fewer data, limiting the bit rate for streaming video, lower image quality, and so on. One can select specific apps to allow metered data usage even when Data Saver is enabled.

The platform also extends the ConnectivityManager to retrieve Data Saver preferences and monitor all the preference changes. One needs put some effort to limit data usage in Android N, but it is worth it.

Accessibility enhancements

Android N now offers Vision Settings on the welcome screen so that users can discover and configure accessibility features such as font size and display size. With these accessibility features, one can test apps early with settings enabled. The new feature also helps users with motor impairments for using the smartphone especially with features such as face-tracking, eye-tracking and so on.

  • Alexander Feterman

    What about Vulkan support? It was supposed to come in this version.