Android Development-api Guide-<grant-uri-permission>

Source: Internet
Author: User

<grant-uri-permission>

English Original: http://developer.android.com/guide/topics/manifest/grant-uri-permission-element.html
Acquisition (update) Date: 2014-6-30
Moved from the original blog: http://blog.sina.com.cn/s/blog_48d491300100zmug.html

Grammar:
<android:path= "string"                      android:pathpattern= "string"                       android:pathprefix= "string"/>
Included in:
<provider>
Description
specifies which subsets of the parent Content Provider access permissions can be authorized. These subsets content: are marked with the path portion. (The authority part of the URI identifies the Content Provider.) This authorization mechanism provides a one-time access to content Provider clients, which are clients that normally do not have access to the data in the content Provider.

If the property value of Content Provider grantUriPermissions is " true ", all data within that Provider can be granted access. If it is set to " false ", only a subset of the data specified by this element can be authorized. A Provider can contain any number of <grant-uri-permission> elements. Each of these can only specify one path (one of three possible attributes).

For more information about how to authorize, see <intent-filter> attributes of an element grantUriPermissions .

Property:
android:path
android:pathPrefix
android:pathPattern
Identifies the path portion of one or more subsets of data that can be authorized. pathproperty specifies the full path, and only a subset of the data that is part of the specified path is authorized. pathPrefixproperty to specify the starting part of the path, and only those data that is prefixed with this path are authorized. pathPatternproperty also specifies the full path, except that it can contain the following wildcard characters:
  • The asterisk (' * ) matches 0 or more occurrences of the preceding character immediately.
  • A period plus an asterisk (" .* ") matches any character 0 or more times.

When reading a string from XML (before parsing as an expression), ' \ is used as an escape character and therefore requires two escapes: for example, ' * should be written ', ' \\* \ should be written ' \\\\ . This is basically the same as the syntax for constructing strings in Java code.

For more information about these three expressions, see the PatternMatcher PATTERN_LITERAL , and descriptions in the class PATTERN_PREFIX PATTERN_SIMPLE_GLOB .

Introduced from:
API Level 1
See:
<provider> The attributes of the element grantUriPermissions .

Android Development-api Guide-<grant-uri-permission>

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.