After the Android 6.0 version, the new permission system appeared, in order to better protect the user's security, the new permission system requires the developer to manually apply in code, so in order to fit the 6.0 privilege system, we have to learn the authority system
Android 6.0 new permissions system classification there are two types of
- Normal permission (normal): This type of permission does not directly threaten the privacy of the user, can be directly registered in the manifest list, the system will help us to authorize the default
- Dangerous Permissions (Dangerous): This can directly to the app to access the user some sensitive data, not only need to register in the manifest list, while in use, you need to request authorization to the system
Characteristics of dangerous rights
- Dangerous permissions are assigned by group, and other permissions in the group are agreed by default as long as a permission for the same group is agreed upon
General Permissions List graph
Dangerous rights group diagram
The application of the authority is very humane, similar to our visa procedures, its application procedures are
- DECLARE this permission
- Check if the permission is already available
- Apply permission if not
- Receive request success or failure callback
① to use permissions, don't forget to apply in manifest
② apply for a single permission
③ requesting multiple permissions
If you want to apply for multiple permissions at the same time, you can transfer the permission to apply in the Requestpermissions
④ to determine the Android 6.0 system
For the rigor of the code, under the Android 6.0 we do not have to apply manually, it is necessary to determine the version of Android
Many times the user accidentally click on the refusal, or fear that the mobile phone information stolen and point of refusal, when the second time into the program, summary we have to do the corresponding processing, here first look at the following method of explanation
Knowing the principle of this method, then the code can be written out quickly, the following is directly affixed to the complete code
Realize
Android Basics-The new access system for Android 6.0