Relationship between Android version and API
The version number | API level | Version_code |
---|---|---|
The Android 4.4 | 19 | KITKAT |
The Android 5.0 | 21 | Lollipop |
The Android 6.0 | 23 | M |
The Android 7.0 | 24 | N |
The Android 8.0 | 26 | O |
The Android 9.0 | 28 | P |
The Android 10.0 | 29 | Q |
Android version App adaptation points
Refer to the connection
The Android 6.0
- Runtime permissions
- Disable support for ApacheHTTP clients and use HttpURLConnection instead
- Low power consumption mode
The Android 7.0
- FileProvider
For Android 7.0 oriented applications, StrictMode API policies enforced by the Android framework prohibit exposing the file:// URI outside of your application. If an intent containing the URI of the file leaves your application, the application fails and a FileUriExposedException occurs.
To share files between applications, you should send a Content :// URI and grant temporary access to the URI. The simplest way to do this authorization is to use the FileProvider class 2.v2 signature
The Android 8.0
-
Adaptive initiator icon
-
Background execution restriction
- When a user enters the cached state, if there are no active components, the system will release all wakeup locks that the application has.
- Applications cannot register implicit broadcasts (a broadcast that is not specific to the application) using manifest. However, these broadcasts can be registered at run time, and explicit broadcasts specific to them can be registered using manifest.
- StartForegroundService () cannot be used in the background. You must start the foreground service through startForegroundService
- After the startForegroundService method is called, call the startForeground method (configuration notification bar) within 5 seconds or the system will stop the service and declare the application as ANR
-
These are the service constraints in the background. When is an application considered to be in the foreground?
- Visible Activity (whether the Activity is started or paused)
- Table service
- A foreground application is associated with the application (either by binding to one of the services or by using one of the content providers)
-
Notification setting channel groups also support notification corners
-
Suspension window limit
-
Multiple Windows, picture in picture
-
A shortcut
-
Maximum screen aspect ratio
The Android 9.0
- Restrictions on non-SDK interfaces
- To use foreground services, declare the FOREGROUND_SERVICE permission in the XML
- Applications with the build.serial identifier must request the READ_PHONE_STATE permission and then use the new build.getSerial () function added in Android 9.
- The application is in the background and cannot access the microphone, camera, or sensor
- Plaintext support is disabled by default, so HTTP requests are not allowed and HTTPS is required.
The Android 10.0
- Partitioned storage: An application in a sandbox is its own folder, and no permission is required to access this folder
- You must apply for the ACCESS_BACKGROUND_LOCATION permission for background location
- Unique identifier of the device. Applications must have the READ_PRIVILEGED_PHONE_STATE signature permission to access the non-reset identifiers (including the IMEI and sequence number) of the device.