Monday 14 March 2016

ANDROID N FEATURES OVERVIEW

Android N is still in active development, but you can try it now as part of the N Developer Preview. The sections below highlight some of the new features for developers.
Make sure to check out the Behavior Changes to learn about areas where platform changes may affect your apps, take a look at the developer guides to learn more about key features, and download theAPI Reference for details on new APIs.

Multi-window support


In Android N, we're introducing 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 phones and tablets running Android N, users can run two apps side-by-side or one-above-the-other in splitscreen mode. Users can resize the apps by dragging the divider between them.
·         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. See below for more information.

Applications running in split-screen mode.

Notification enhancements


In Android N we've redesigned notifications to make them easier and faster to use. Some of the changes include:
·         Template updates: We'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.
·         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. 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.

Bundled notifications and direct reply.

Profile-guided JIT/AOT compilation


In Android N, we'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.

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.

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.

Doze now applies restrictions to improve battery life even when the device is not stationary.
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.
.

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.

Data Saver



 Data Saver in Settings.
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.

Quick Settings Tile API



 Quick Settings tiles in the notification shade.
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.

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 provider 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

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
.

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.

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.

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.

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.

Android for Work


Android for Work adds many new features and APIs for devices running Android N. Some highlights are below — for a complete list of Android for Work updates related to Android N, please see Android for Work Changes.

Work profile security challenge

Profile owners can specify a separate security challenge for apps running in the work profile. The work challenge is shown when a user attempts to open any work apps. Successful completion of the security challenge unlocks the work profile and decrypts it if necessary. For profile owners, ACTION_SET_NEW_PASSWORD prompts the user to set a work challenge, and ACTION_SET_NEW_PARENT_PROFILE_PASSWORD prompts the user to set a device lock.

Encryption Decryption Example Android Using AES Alogirthm

activity_main.xml ------------------------- <?xml version="1.0" encoding="utf-8"?> <LinearLayou...