AndroidManifest. xml file (permission)

Source: Internet
Author: User

SYNTAX (SYNTAX ):

<Permissionandroid: description = "string resource"
Android: icon = "drawable resource"
Android: label = "string resource"
Android: name = "string"
Android: permissionGroup = "string"
Android: protectionLevel = ["normal" | "dangerous" |
"Signature" | "signatureOrSystem"]/>

Included IN (contained in ):

<Manifest>

DESCRIPTION ):

This element is used to declare a security permission to restrict access to specific components, or component functions, or other applications.

ATTRIBUTES (ATTRIBUTES ):

Android: description

This attribute is used to define a readable and understandable description for the permission. It is longer and more detailed than the label. It can be displayed to the user to explain the meaning of permissions to the user-for example, when asking whether the user wants to grant the corresponding permissions to another application, the description defined by this attribute is displayed to the user.

Android: icon

This attribute references a printable icon resource to represent this permission.

Android: label

This attribute defines a permission name that can be displayed to the user.

For convenience, this tag can directly use native strings when developing applications. However, when an application is to be officially released, it uses a string resource to set it so that it can be localized like other strings on the user interface.

Android: name

This attribute defines the permission name. It is the name of the permission referenced in the program code-for example, the permission attribute in a <uses-permission> element and the application component.

This name must be unique, so you must use a naming rule for the Java style-for example: com. example. project. PERMITTED_ACTION

Android: permissionGroup

This attribute is used to assign this permission to a permission group. The value of this attribute is the name of a permission group. It must be a permission group declared by the <permission-group> element in this application or another application. If this attribute is not set, this permission does not belong to any permission group.

Android: protectionLevel

Privilege represents a potential risk. Therefore, this attribute definition is used to indicate the process that the system should follow when determining whether to grant the permission to the requested application. It may be one of the values in the table.

 

Value Description
Normal Default value. This is a low-risk permission that allows requested applications to access independent application-level functions. It minimizes the risk for another application, system, or user. The system automatically grants this type of permission to the requested application when installing the application, without the user's explicit approval (although before installing the application, you can always select to view these permissions ).
Dangerous This is a high-risk authorization, which allows applications requesting this permission to access private user data or control user devices, thus negatively affecting users. Because this permission introduces potential risks, the system will not automatically grant this permission to the application requesting this permission. For example, the permissions of the dangerous type requested by the application can be displayed to the user before confirmation and processing, or some other methods can be used, to prevent the user from automatically granting permissions to the requested application.
Signature The system only grants this permission to applications with the same digital signature. That is, the application requesting this permission must have the same digital signature as the application declaring this permission. If the certificate matches, the system automatically sends the application with the permission request without notifying the user or requiring explicit approval from the user.
SignatureOrSystem The system only grants this permission to applications in the Android system image, or applications with the same certificate signature as those in the system image. Avoid using this option because the signature type permissions should be sufficient to meet the needs of most jobs. SingatureOrSystem permissions are mainly used in some specific scenarios. For example, multiple vendors have applications to be built in system images, and they share some specific special functions.
 

 

INTRODUCED version (introduced in ):

API Level 1

 


From FireOfStar's column

Related Article

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.