Android Official documents: (ii) app list--2.26 <uses-permission> tags

Source: Internet
Author: User

Syntax
<uses-permissionandroid:name="string"  android:maxsdkversion="integer"  />
Contained in:
<manifest>
Description
Requests a permission that the application must is granted inorder for it to operate correctly. Permissions was granted by the user when the application was installed, not while it ' s running.

For more information on permissions, see the permissions sections in the introduction and the separate Security and Permiss Ions document. A List of permissions defined by the base platform can is found at android.Manifest.permission .

Attributes
android:name
The name of the
permission. It can be a permission defined <permission> by the application with the element, a permission defined by another application, O R one of the standard system permissions, such as "" or "" android.permission.CAMERA android.permission.READ_CONTACTS . As these examples show, a permission name typically includes the package name as a prefix.
android:maxSdkVersion
The highest API level is which this permission should is granted to your app. Setting This attribute is useful if the permission your app requires are no longer needed beginningat a certain API level.

For example, beginning with Android 4.4 (API level), it's no longer necessary for your Appto request the WRITE_EXTERNAL_STORAGE Permissi On while YourApp wants to write to the IT own application-specific directories on external storage (the directoriesprovided by getExternalFilesDir()). However,the permission is required for API level and lower. So you can declare, that thispermission are needed only on the API level and a declaration such as this:

<uses-permission   android:name="Android.permission.WRITE_EXTERNAL_STORAGE"    Android:maxsdkversion="/> "

This is, beginning with API level, the system would no longer grant your app the WRITE_EXTERNAL_STORAGE permission.

Introduced in:
API Level 1
See also:
  • <permission>
  • <uses-feature>
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.