What changes have been made to Android N
First, performance improvement
- Doze Super Power Save mode
Mobile phone in off at the same time there is no charging situation, will enter the NAP state, the app location service, access network, CPU background-running and other background services will be stopped, do not allow scheduled tasks, ignore wake locks, stop WiFi scanner.
Will affect the app's keepalive, especially for apps that need to receive message classes. Google recommends using GCM.
- Background optimization
Broadcasting:
Static registration Connectivity_action broadcasts will fail, only the dynamic registration can be done. On Android 5.0, you can use Jobscheduler to run your tasks on specified network conditions, and you can also monitor network status through Connectivitymanager registernetworkcallback ().
Action_new_picture,action_new_video broadcasts have been removed and of course the application can be monitored by contentresolver. Android n above can be jobscheduler to monitor
Second, the NDK trial change
Limit only try the platform public API, otherwise your application will be crash, preferably only the API included in the NDK, otherwise the system is customized may not be able to find the so you want to link, followed by third-party so when also pay attention to the other side has a wooden trial illegal so.
Third, screen Zoom
Users can change to a screen width of 320DP, so the app is best suited to SW320DP, when your compile target < Android N, when the user changes the screen display size, will kill the background process (your app will be killed OH)
Iv. Language and Locale
Support multi-user multi-lingual environment, provide new API:LocaleList.GetDefault (), can get all user's language environment.
At the same time, the app multilingual search strategy changes, when your app is not in the current locale's resources, will find the closest language instead, instead of using the default language directly instead. For example: The resources of your app only include ES, and ZH_CN, when the user's environment is ZH_TW, will be replaced with ZH_CN. It also supports custom language catalogs.
V. Multi-window support
Multi-window is supported by default on Android n machines, and multiple app windows can be run on the same screen. There are two modes, Split-screen mode and picture-in-picture mode. The app opens and closes these two modes very conveniently, in the Androidmanifest.xml configuration can.
Android:resizeableactivity=["true" | "False"]
Android:supportspictureinpicture=["true" | "False"]
This mode is suitable for tablets.
Liu, notifications
Android N provides some new APIs about notifications.
Remoteinput.builder: Allows users to respond directly to the notification bar, which is ideal for social apps and SMS apps, and can be applied to user feedback.
NotificationCompat.Builder.setGroup (): You can put the same app notification in the same group.
Notificationmanager: Lets you know how many notifications you are sending, and how you can notify them to group.
Vii. Data Saver
When users turn on traffic savings, the app will be blocked from using the paid network traffic data in the background. Even when traffic is used in the foreground, a warning is issued.
Connectivitymanager.isactivenetworkmetered (),
Connectivitymanager.isactivenetworkmetered (),
Query whether to turn on the traffic Saver mode, whether you are in the user whitelist (exception to yourself)
Connectivitymanager.action_restrict_background_changed
Monitor user-enabled Traffic Saver mode
Viii. Network Security Configuration
Enables the app to customize network security settings:
- Debug-only Overrides ( CA for custom credits).
- Debug-only Overrides ( Customize the CA that can debug your app credit)
- cleartext Traffic opt-out(prevents network requests for clear text interaction)
- Certificate Pinning ( Custom Credit only contains a specific public key CA)
This feature, for the payment class software, financial and shopping category is the Gospel Ah, prevent hijacking, prevent redirection.
These configurations do not require you to change the code, just add the configuration file.
Ix. Other
Partial support for icu4j (can support internationalized localization data display well).
Supports Java 8 language features (lambda expressions can be used)
、
In short: Android N for users to increase the power management, traffic management, memory management, storage management, notification management, etc., to provide more reliable security capabilities, to meet user personalized needs, improve the user experience of the app, improve the performance of mobile phone use, convenient for app developers.
Reference Links:
Https://developer.android.com/intl/zh-cn/preview/j8-jack.html
Http://developer.android.com/intl/zh-cn/preview/samples.html
Https://developer.android.com/intl/zh-cn/training/monitoring-device-state/doze-standby.html
Http://www.pcpop.com/doc/2/2571/2571412.shtml
What does Android n do?