Android Rights Management (continuous grooming)

Source: Internet
Author: User

1. Android 6.0, the app direct Android, the runtime asks the user to grant the relevant permissions, the system pops up a dialog box, (this dialog box can not be customized by the developer)

Users can also manage permissions for an app in the phone's settings

Note: This dialog box is not automatically ejected by the system, but rather a developer who calls a method that must be authorized by the user, checks (if there is authorization to call directly) and requests user permissions before calling, which may cause a direct program crash due to no authorization

Focus: Check for and request user permissions in a place that requires user permissions, or the program crashes

2. Classification of permissions

Whether it involves user privacy, permissions are divided into two categories: the first category does not involve privacy, in the manifest declaration, such as Bluetooth, network,NFC , etc.

The second category relates to privacy: SD card read/write, contacts, SMS, etc.

3. The concept of a permission group

All dangerous Android system permissions belong to permission group

4. The runtime does not require authorized permissions:

The first kind of permission, does not involve the user's privacy permission, in the manifest declaration can, moreover, installs and obtains the authorization, the user cannot cancel, unless uninstalls.

5. Run-time permissions required for authorization

Condition: The app runs on Android 6.0 (API 23) or higher, and targetsdkversion>=23, the system will automatically adopt the Dynamic rights rights policy

Precautions:

(1) Such permission must be declared in manifest so that the user is prompted for authorization upon application. Otherwise, directly callback developer permissions and be rejected

(2) Apply for a certain permission, the System popup dialog is a description of the entire permission group

(3) because (2) Therefore, one of the permissions of the same permission group is authorized, and other rights in the same group are granted automatically

6. Systems that are below Android 6.0 still use the old Rights Management policy:

(1) Request user authorization permission when installing

(2) Authorization for permission groups, not one permission

7. Data storage

Github:https://github.com/yanzhenjie/andpermission

Https://github.com/yanzhenjie/AndPermission/blob/master/README-CN.md

8. Pending extension:
Dynamic Rights Management Policy: Practice, Demo

Android Rights Management (continuous grooming)

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.