top of page
Search
Writer's pictureAbhinaw Tripathi

Android N API Review


Along with new features and capabilities, Android N includes a variety of system and API behavior changes.Android N is still in active development, but you can try it now as part of the N Developer Preview.

Below are the following changes in in Android N:

1)Multi-window Support:

In Android N, new features has been introduced such as a new and much-requested multitasking feature into the platform — multi-window support.Users can now pop open two apps on the screen at once.On Android TV devices, apps can put themselves in picture-in-picture mode, allowing them to continue showing content while the user browses or interacts with other apps.

2)Notification Enhancements:

In Android N, redesigned notifications to make them easier and faster to use. Some of the changes include:

Template updates: They're updating notification templates to put a new emphasis on hero image and avatar. Developers will be able to take advantage of the new templates with minimal adjustments in their code.

Messaging style customization: You can customize more of the user interface labels associated with your notifications using the MessagingStyle class. You can configure the message, conversation title, and content view.

Bundled notifications: The system can group messages together, for example by message topic, and display the group. A user can take actions, such as Dismiss or Archive, on them in place. If you’ve implemented notifications for Android Wear, you’ll already be familiar with this model.

Direct reply: For real-time communication apps, the Android system supports inline replies so that users can quickly respond to an SMS or text message directly within the notification interface.

Custom views: Two new APIs enable you to leverage system decorations, such as notification headers and actions, when using custom views in notifications.

3) Profile-guided JIT/AOT Compilation:

In Android N, they've added a Just in Time (JIT) compiler with code profiling to ART, which lets it constantly improve the performance of Android apps as they run. The JIT compiler complements ART's current Ahead of Time (AOT) compiler and helps improve runtime performance, save storage space, and speed up app updates and system updates.

Profile-guided compilation lets ART manage the AOT/JIT compilation for each app according to its actual usage, as well as conditions on the device. For example, ART maintains a profile of each app's hot methods and can precompile and cache those methods for best performance. It leaves other parts of the app uncompiled until they are actually used.

Besides improving performance for key parts of the app, profile-guided compilation helps reduce an app's overall RAM footprint, including associated binaries. This feature is especially important on low-memory devices.

ART manages profile-guided compilation in a way that minimizes impact on the device battery. It does precompilation only when then the device is idle and charging, saving time and battery by doing that work in advance.

4)Quick Path to App Install:

One of the most tangible benefits of ART's JIT compiler is the speed of app installs and system updates. Even large apps that required several minutes to optimize and install in Android 6.0 can now install in just a matter of seconds. System updates are also faster, since there's no more optimizing step.

5)Doze on the Go:

Android 6.0 introduced Doze, a system mode that saves battery by deferring apps' CPU and network activities when the device is idle, such as when it's sitting on a table or in a drawer.

Now in Android N, Doze takes a step further and saves battery while on the go. Any time the screen is off for a period of time and the device is unplugged, Doze applies a subset of the familiar CPU and network restrictions to apps. This means users can save battery even when carrying their devices in their pockets.

A short time after the screen turns off while the device is on battery, Doze restricts network access and defers jobs and syncs. During brief maintenance windows, applications are allowed network access and any of their deferred jobs/syncs are executed. Turning the screen on or plugging in the device brings the device out of Doze.

When the device is stationary again, with screen off and on battery for a period of time, Doze applies the full CPU and network restrictions on PowerManager.WakeLock, AlarmManager alarms, and GPS/Wi-Fi scans.

The best practices for adapting your app to Doze are the same whether the device is moving or not, so if you already updated your app to gracefully handle Doze, you're all set. If not, start adapting your app to Doze now.

6)Project Svelte: Background Optimizations:

Project Svelte is an ongoing effort to minimize RAM use by system and apps across the range of Android devices in the ecosystem. In Android N, Project Svelte is focused on optimizing the way apps run in the background.

Background processing is an essential part of most apps. When handled right, it can make your user experience amazing — immediate, fast, and context-aware. When not handled right, background processing can needlessly consume RAM (and battery) and affect system performance for other apps.

Since Android 5.0, JobScheduler has been the preferred way of performing background work in a way that's good for users. Apps can schedule jobs while letting the system optimize based on memory, power, and connectivity conditions. JobScheduler offers control and simplicity, and we want all apps to use it.

Another good option is GCMNetworkManager, part of Google Play Services, which offers similar job scheduling with compatibility across legacy versions of Android.

We're continuing to extend JobScheduler and GCMNetworkManager to meet more of your use cases — for example, in Android N you can now schedule background work based on changes in Content Providers. At the same time we're starting to deprecate some of the older patterns that can reduce system performance, especially on low-memory devices.

In Android N we're removing three commonly-used implicit broadcasts — CONNECTIVITY_ACTION, ACTION_NEW_PICTURE, and ACTION_NEW_VIDEO — since those can wake the background processes of multiple apps at once and strain memory and battery. If your app is receiving these, take advantage of the N Developer Preview to migrate to JobScheduler and related APIs instead.

7)SurfaceView:

Android N brings synchronous movement to the SurfaceView class, which provides better battery performance than TextureView in certain cases: 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 compositing on screen, because it is composited in dedicated hardware, separately from app window content. As a result, it makes fewer intermediate copies than TextureView. A SurfaceView object's content position is now updated synchronously with the containing app content. One result of this change is that simple translations or scales of a video playing in a SurfaceView no longer produce black bars alongside the view as it moves.

Starting with Android N, we strongly recommend that you save power by using SurfaceView instead of TextureView.

8)Data Saver:

Over the life of a mobile device, the cost of a cellular data plan typically exceeds the cost of the device itself. For many users, cellular data is an expensive resource that they want to conserve.

Android N introduces Data Saver mode, a new system service that helps reduce cellular data use by apps, whether roaming, near the end of the billing cycle, or on a small prepaid data pack. Data Saver gives users control over how apps use cellular data and lets developers provide more efficient service when Data Saver is on.

When a user enables Data Saver in Settings and the device is on a metered network, the system blocks background data usage and signals apps to use less data in the foreground wherever possible — such as by limiting bit rate for streaming, reducing image quality, deferring optimistic precaching, and so on. Users can whitelist specific apps to allow background metered data usage even when Data Saver is turned on.

Android N extends the ConnectivityManager to provide apps a way to retrieve the user's Data Saver preferences and monitor preference changes. All apps should check whether the user has enabled Data Saver and make an effort to limit foreground and background data usage.

9)Vulkan API:

Android N integrates Vulkan™, a new 3D rendering API, into the platform. Like OpenGL™ ES, Vulkan is an open standard for 3D graphics and rendering maintained by the Khronos Group.

Vulkan is designed from the ground up to minimize CPU overhead in the driver, and allow your application to control GPU operation more directly. Vulkan also enables better parallelization by allowing multiple threads to perform work such as command buffer construction at once.

Vulkan development tools and libraries are rolled into the Android NDK. They include:

Headers Validation layers (debug libraries) SPIR-V shader compiler SPIR-V runtime shader compilation library Vulkan is only available to apps on devices with Vulkan-capable hardware, such as Nexus 5X, Nexus 6P, and Nexus Player. We're working closely with our partners to bring Vulkan to more devices as soon as possible.

10)Quick Settings Tile API:

Quick Settings is a popular and simple way to expose key settings and actions, directly from the notification shade. In Android N, we've expanded the scope of Quick Settings to make it even more useful and convenient.

We've added more room for additional Quick Settings tiles, which users can access across a paginated display area by swiping left or right. We've also given users control over what Quick Settings tiles appear and where they are displayed — users can add or move tiles just by dragging and dropping them.

For developers, Android N also adds a new API that lets you define your own Quick Settings tiles to give users easy access to key controls and actions in your app.

Quick Settings tiles are reserved for controls or actions that are either urgently required or frequently used, and should not be used as shortcuts to launching an app.

Once you’ve defined your tiles, you can surface them to users, who can add them to Quick Settings just by drag and drop.

11)Number Blocking:

Android N now supports number blocking in the platform and provides a framework API to let service providers maintain a blocked-number list. The default SMS app, the default phone app, and carrier apps can read from and write to the blocked-number list. The list is not accessible to other apps.

By making number blocking a standard feature of the platform, Android provides a consistent way for apps to support number blocking across a wide range of devices. Among the other benefits that apps can take advantage of are:

Numbers blocked on calls are also blocked on texts Blocked numbers can persist across resets and devices through the Backup & Restore feature Multiple apps can use the same blocked numbers list Additionally, carrier app integration through Android means that carriers can read the blocked numbers list on the device and perform service-side blocking for the user in order to stop unwanted calls and texts from reaching the user through any medium, such as a VOIP endpoint or forwarding phones.

12)Call Screening:

Android N allows the default phone app to screen incoming calls. The phone app does this by implementing the new CallScreeningService, which allows the phone app to perform a number of actions based on an incoming call's Call.Details, such as:

Reject the incoming call Do not allow the call to the call log Do not show the user a notification for the call.

13)Multi-locale Support, More Languages:

Android N now lets users select multiple locales in Settings, to better support bilingual use-cases. Apps can use a new API to get the user's selected locales and then offer more sophisticated user experiences for multi-locale users — such as showing search results in multiple languages and not offering to translate webpages in a language the user already knows.

Along with multi-locale support, Android N also expands the range of languages available to users. It offers more than 25 variants each for commonly used languages such as English, Spanish, French, and Arabic. It also adds partial support for more than 100 new languages.

Apps can get the list of locales set by the user by calling LocaleList.GetDefault(). To support the expanded number of locales, Android N is changing the way that it resolves resources. Make sure that you test and verify that your apps working as expected with the new resource resolution logic.

14)New Emojis:

Android N introduces additional emojis and emoji-related features including skin tone emojis and support for variation selectors. If your app supports emojis, follow the guidelines below to take advantage of these emoji-related features.

Check that a device contains an emoji before inserting it. To check which emojis are present in the system font, use the hasGlyph(String) method. Check that an emoji supports variation selectors. Variation selectors allow you to present certain emojis in color or in black-and-white. On mobile devices, apps should represent emojis in color rather than black-and-white. However, if your app displays emojis inline with text, then it should use the black-and-white variation. To determine whether an emoji has a variation, use the variation selector. For a complete list of characters with variations, review the emoji variation sequences section of the Unicode documentation on variations. Check that an emoji supports skin tone. Android N allows users to modify the rendered skin tone of emojis to their preference. Keyboard apps should provide visual indications for emojis that have multiple skin tones and should allow users to select the skin tone that they prefer. To determine which system emojis have skin tone modifiers, use the hasGlyph(String) method. You can determine which emojis use skin tones by reading the Unicode documentation.

15)ICU4J APIs in Android:

Android N now offers a subset of ICU4J APIs in the Android framework under the android.icu package. Migration is easy, and mostly entails simply changing from the com.java.icu namespace to android.icu. If you are already using an ICU4J bundle in your apps, switching to the android.icu APIs provided in the Android framework can produce substantial savings in APK size.

16)OpenGL™ ES 3.2 API:

Android N adds framework interfaces and platform support for OpenGL ES 3.2, including:

All extensions from the Android Extension Pack (AEP) except for EXT_texture_sRGB_decode. Floating-point framebuffers for HDR and deferred shading. BaseVertex draw calls to enable better batching and streaming. Robust buffer access control to reduce WebGL overhead. The framework API for OpenGL ES 3.2 on Android N is provided with the GLES32 class. When using OpenGL ES 3.2, be sure to declare the requirement in your manifest file, using the <uses-feature> tag and the android:glEsVersion attribute.

For information about using OpenGL ES, including how to check a device's supported OpenGL ES version at runtime, see the OpenGL ES API guide.

17)Android TV Recording:

Android N adds the ability to record and playback content from Android TV input services via new recording APIs. Building on top of existing time-shifting APIs, TV input services can control what channel data can be recorded, how recorded sessions are saved, and manage user interaction with recorded content.

3 views0 comments

Recent Posts

See All
bottom of page