Play with the Dark Horse programmer Android N

Source: Internet
Author: User
Tags billing cycle

Beijing time May 19 1 o'clock in the morning, Google hosted the 2016 I/O developer conference in Mountain View, California, USA. It is a world-wide event for developers to introduce systems and software updates. This year I/O conference Google launched a number of new products, including Android N (7.0), Smart wearable AndroidWear2.0, smart home, VR virtual reality and so on.


While the overall focus of the conference is on AI (Google Assistant, Allo&duo, Google Home), the Android operating system is the "core" of smart devices (Android systems from watches, mobile phones to TVs, cars, With more than 600 Android smartphones listed last year, with 100 cars now supporting Android, Androidn is still one of the most important points of I/O conference.

Android N New Feature summary

At this I/O developer conference, Google released a new generation of Android systems: Android N (7.0), this year's Android N focused on three dimensions : performance, security and productivity, respectively. The main performance of the new Vulkan API and JIT compiler (the former to optimize graphics performance, or speed up software installation); security includes new data encryption methods, malicious website identification, real-time system updates; productivity Aspect has joined the split-screen multitasking function, the program fast switch, all applications can support "multi-window Mode". Of course, you can also make the app not support multi-window mode by modifying the configuration.

First, Android n new features the most bright spot

• Split-screen multi-tasking

The line between smartphones and tablets is constantly breaking as the size of the phone constantly refreshes the ceiling. The large screen brings a great visual experience while also enabling people to manipulate the screen area a lot. Large-size screens also offer the possibility of split-screen multitasking.

A split-screen multitasking that was previously only available on a PC can now be run on a smartphone. However, different Android ROM implementation of this feature, the compatibility of the software is very different, it is difficult to make all the app perfectly compatible. and Android N New split-screen multitasking, in addition to the third-party ROM developers can refer to this template for two of development, software developers can also be based on the Android N-screen multi-tasking function to implement the development of software. Greatly speed up development, and the software that supports this feature will be much more and better compatible.


On phones and tablets running Android N, users can run two apps side-by-side or in Split-screen mode when one app is on top of another. For ANDROIDTV devices, applications can place themselves in picture-in-pictures mode and continue to display content that users browse or interact with other applications.

The way to turn on split-screen multitasking is simple. As soon as you enter the background, hold down one of the cards and drag upward to the top. Of course, this feature supports the left and right split screen, and you can drag the middle of the split line to adjust the ratio of two apps.

• notification

Redesigned notifications in Android N for an easier, faster-to-use effect. Some of the major changes include:

Template update: Updated the notification template highlights and avatar. Developers will be able to take advantage of the new templates to achieve minimal adjustments in their code.

Bundle Notification: Android n notifications are also more user-friendly, will now automatically bundle the same application notifications together to achieve group display, and through two-finger swipe to achieve a preview, in theory, users can directly read the message in the notification interface and other content.

Direct response: For real-time communication applications, the Android system supports online responses, allowing users to respond quickly and directly within a text or SMS notification interface.

Custom Views: Two new APIs allow users to use a custom view in notifications.


Two new API interfaces were added to the Android N Developer Preview Notification System: Direct replies and bundling. The former supports the addition of quick replies and shortcuts to notifications for third-party apps, while the latter allows for notifications to be split by applications that issue multiple notifications at the same time.

When an app is perfect for Android N, you can simply call out the input box in the drop-down notification drawer or even the lock screen when you receive a message, or choose a pre-set quick action (marked as read, forward, etc.). When a user receives a message from a different contact at the same time, they can split the merged notification by clicking the Notification split button on the known card, and the split notification can be answered and processed like any other independent notification.

Of course, the application of these two features at this stage is a handful, except for Google Hangouts, Messenger and Gmail and other applications, currently only found third-party telegram client Plus Messenger support the above features.

In the face of notification pushes for various applications, Android N takes priority-centric notification management, and in Android N, notification management becomes simpler: simply swipe left and right on the corresponding notification to see a settings icon, Click on the icon to be able to call out a simple notification priority setting interface, in this interface can be set to "silent display", "Block all Notifications" and "default" three levels.


If the "Show fullimportance Settings" feature is turned on in the System interface tuner-Others, these three levels will change to "shielded-low-general-high-emergency" 5, and the setting is also changed from the vertical option to the left and right slide. This seemingly novel design is actually a simplification of the existing notification management operations, in Android 6.0 need to jump back and forth in two interface to complete the operation, in the Android7.0 is only used in one interface can be done.

At the same time, Google has moved its definition of notification priority from "behind the scenes" to "front", and Google will also alert you to the notification effects of different priorities when performing a full five-level priority setting. Finally, the Do Not Disturb mode is also perfected in androidn, adding automatic rules and allowing users to block silent notifications in "Do Not Disturb" mode or even the phone's notification LEDs.

Second, Android N new features continuous improvement

• Improved doze sleep mechanism

in Android 6.0, Google has brought a new sleep mechanism to doze. According to officials, the battery can be extended for several hours after opening doze. Although the actual test is not as good as Google says, it still has a certain effect on the battery life. The doze hibernation mechanism is a system mode that saves power by delaying the application's CPU and network activity when the device is in an idle state.


in Android N, the doze hibernation mechanism is another step forward. As long as the screen is closed for a while, and the device is not plugged in, the doze hibernation mechanism is turned on, and the system tries to conserve power by restricting network access and CPU-intensive services, which means that users can save power even if they put the device in their pocket.

Specifically, the doze hibernation mechanism restricts network access while the device is on battery when the screen is closed for a few moments, delaying the job and synchronizing. After a short period of maintenance, it allows the application to access the network and perform deferred job/synchronization. Opening the screen or plugging the device into power causes the device to exit the doze hibernation mechanism. The Doze sleep mechanism applies full CPU and network limits for Powermanager.wakelock,alarmmanager alerts and GPS/WI-FI scans when the device is still in a standstill state, and the screen is turned off and using the battery for a period of time.


It is worth mentioning that the new Doze mode is also a powerful combination with project svelte, Android N will be a miracle in standby.

· Project Svelte background optimization

Project svelte is an effective algorithm for improving the use of storage during the Androidkitkat period, and it continues to improve to minimize the amount of RAM used by systems and applications in a range of Android devices in the ecosystem. In Android N, Project svelte focuses on optimizing how apps are run in the background. Background processing is an important part of most applications. It can be handled in a timely and fast-to-reach experience. It is not necessary to consume RAM (and batteries) unnecessarily, and also affect the system performance of other applications.

Since Android 5.0,Jobscheduler has become the first choice for performing background work. The application allows the system to be optimized based on memory, power, and connection conditions while scheduling the job. The Jobscheduler allows for control and simplicity. The other is Gcmnetworkmanager(part of the Google Play Service), which offers similar job scheduling and compatibility in older versions of Android. Google continues to expand Jobscheduler and Gcmnetworkmanager to conform to multiple use cases. In Android N, you can schedule background work based on changes in the content provider. Deprecated some older patterns that would degrade system performance.

In Android N, three commonly used implicit broadcasts were removed:-connectivity_action, Action_new_picture, and Action_new_video. These broadcasts may wake up the background processes of multiple apps at once, while draining memory and batteries.

• Flow Savings Program (data Saver)

The cost of a cellular data plan typically exceeds the cost of the device itself over the life cycle of a mobile device. For many users, cellular data is the expensive resource they want to save. Android N provides a global flow control mechanism: Data Saver mode. This new system service helps reduce cellular data used by applications, whether it's roaming, the end of the billing cycle, or the use of a small amount of prepaid packets. Effectively prevents the application from maliciously stealing mobile traffic in the background. This feature is turned off by default, and once turned on, other apps, except for GMs (Google Mobile service, Google Mobility Services), do not allow the use of mobile traffic that exceeds the foreground in the background by default.

Data Saver allows users to control how applications use cellular data, while allowing developers to open data Saver to provide more effective services. For developers, in the Android N system to proactively check whether users turn on the traffic saver, and pay attention to save the background of data traffic consumption.

When users enable Datasaver in Settings and the device is on a metered network, the system masks the use of background data and instructs the app to use as little data as possible in the foreground. For example, it is achieved by limiting the bitrate for streaming media services, reducing image quality, and delaying the best pre-buffering. Whitelist specific apps to allow background data to be used by traffic, even when you open data Saver.

Android N inherits the Connectivitymanager to provide a way for the app to retrieve the user's Datasaver preferences and monitor the preference changes. All apps should check if the user has data Saver enabled and try to limit the use of foreground and background data.

• Scope Directory Access

In Android N, apps can use the new API to request access to specific external storage directories, including directories on removable media, such as SD cards. The new API greatly simplifies the way applications access standard external storage directories, such as the Pictures directory. Applications can use these APIs (instead of using read_external_storage), which grants access to all storage directories or the storage access framework, allowing users to navigate to the directory.

In addition, the new API simplifies the steps for users to grant external storage access to the app. When you use the new API, the system uses a simple permissions UI.

• Quick Setup Bar API

Quick Setup is typically used to display key settings and actions directly from the notification bar, which is very simple. In Android N, the range of "Quick settings" has been extended to make it more useful and convenient. Google adds more space to the extra quick settings tile, and users can access them by swiping left or right across the display area of the pagination. It also gives users control over which quick settings tiles are displayed and where they are displayed-users can drag and drop tiles to add or move tiles.

For developers, Android N also adds a new API that allows you to define your own "Quick settings" Tile, which makes it easy to access key controls and actions in your app. For controls and actions that are needed or frequently used, leave the quick settings Tile and should not be used as a shortcut to launch the app.


Profile-guided JIT (Just in Time)/AOT compilation

Androidn introduces a hybrid runtime that includes compilation, interpretation, and JIT (Just InTime) to get the best tradeoff between installation time, memory footprint, battery consumption, and performance.

Art replaces Dalvik, but preserves bytecode-level compatibility, one of the main features of Art is the AOT compilation of the application at install time. The main advantage of this approach is that optimization produces better native code performance and requires less power to execute. In Lollipop and Marshmallow (Android 6.0), large applications take several minutes to install. Android in N, added the code Analysis JIT compiler technology to improve the performance of Android applications. The application does not compile at the time of installation, but instead interprets the bytecode, so it can be started quickly. The JIT compiler complements art's current time advance (AOT) compiler to help improve runtime performance, save storage space, and accelerate application updates and system updates.

There is a new, faster interpreter in art that is done with a new JIT, but this JIT information is not persisted. Instead, the code is parsed during execution and the results are saved. When the device is idling and charging, art performs an analysis-based compilation of the "Hot Code," and the other code does not compile. To get better code, art employs several techniques, including deep inline.

The full advantage of this mix of AOT, interpretation, and JIT strategies is that the installation time can be shortened to a few seconds, even in large applications, and the system upgrade can be installed faster because it eliminates the need to optimize this step, the memory footprint of the application is smaller, some cases can be reduced by 50%, improved performance, and lower battery consumption.

Profile-guided Compile management lets art manage, based on its actual use of each application's Aot/jit compilation, as well as the conditions on the device. Art maintains a hot-method profile for each application that can be precompiled and cached for best performance. Leave other parts of the application that are not compiled until they are actually used.

In addition to improving the performance of critical parts of your application, profile-guided compilation helps reduce the overall memory footprint of your application, including related binaries. This feature is especially important in low memory devices.

· Some ICU4J API support available in Android framework

ICU4J (International componentsfor Unicode) is an IBM-maintained, free Open source Unicode Tool Library based on IBM Public License distribution, and developers can use ICU4J to achieve digital, currency, The time, date, and format of the message, parsing, the case of the string conversion, collation, search and sorting functions.

But since Android N has built-in some icu4j APIs, if the Android app uses only this part of the API, it will no longer be able to integrate a huge icu4j library of around 10MB. Developers can provide a lightweight installation package without icu4j for users who use Android N on Google Play, and a full installation package containing icu4j for earlier systems.


Android N has been released, but considering the various in-depth customization of the Android system in the country to make hardware adaptation, software bundle integration, I believe that the large area of Android N will take some time to popularize.

When Android N has not yet been pushed, the surprise benefits of the Dark Horse are first n a step down the sky! Before the Android n system push, the Black Horse Programmer's excellent lecturer has already recorded the "an Droid N new features course" Video! Dark Horse Programmer's goal is to keep in sync with Google updates, Google released a new version of Android N, Black Horse programmer first time into the development of new courses, and the first time to launch, the purpose is to let the dark horse students have been running in the forefront of the industry, leading the entire industry!

PS : New and old students are free to get the latest Android N course Resources!

attached: Android N Video + data Link: Http://pan.baidu.com/s/1bpC1HGN

"New and old students can always apply to the teacher to play the certificate"

Play with the Dark Horse programmer Android N

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.