Get your apps ready for Android 6.0 marshmallow!
New features: Run-time permission reminders, Doze (snooze mode) and backup power, assist with new technologies, and more.
Android 6.0Changes
With the new features and functionality, Android 6.0 (API level 23) has made some changes to the system and the use of the API.
If we've already released an app, then we need to focus on whether the changes will affect the app's operation.
Runtimepermissions
This is a new permission usage model that allows users to manage the app's permissions directly while the program is running. Provides a transparent and controllable way for users to manage permissions in processes such as simplified installation and automatic upgrades.
Recommendation: Even if your build target setting is not android6.0 (API23), you should test it in the new mode of 6.0.
In 6.0 and later, to request permissions while the program is running.
(1) checkselfpermission ()
Determine if your program has permissions.
(2) Requestpermission ()
Request permission
For details, please refer to:
Dozeand App Standby
power optimization for restricted devices and applications increases battery life, and since this feature affects all applications, it is recommended that the application be tested on 6.0 platforms.
Doze: If a device screen is turned off, at rest, after a period of time, the device enters Doze mode, which attempts to put the device into hibernation. In this mode, the device is periodically restored to a formal state so that the application can occur synchronously, and the system can handle some unfinished operations.
App Standy: When users are not actively using an app, app standby allows the system to default to the app being idle. If the device is not connected to a power source,
The system will disable network connections for the app, pause syncing and other work, and the app is idle.
To learn more about these power-savingchanges, see Optimizingfor Doze and App Standby.
Apachehttp Client Removal
Android 6.0 removes Apache HTTP support, and if the app uses it and the version is greater than or equal to Android2.3, you can replace it with the HttpURLConnection class. This API is more efficient because it reduces network usage and power consumption through transparent compression and response caching.
If you want to continue using the Apache Http API, you must
(1) in the Buid.gradle file, declare:
(2) Introduction jar package: Org.apache.http.legacy.jar
The package address: sdk\platforms\android-23\optional
Android 6.0 System cotton candy new features and functions