Android Manifest & lt; provider & gt; element Chinese comment

Source: Internet
Author: User

Syntax
<Provider android: authorities = "list"

Android: enabled = ["true" | "false"]

Android: exported = ["true" | "false"]

Android: grantUriPermissions = ["true" | "false"]

Android: icon = "drawable resource"

Android: initOrder = "integer"

Android: label = "string resource"

Android: multiprocess = ["true" | "false"]

Android: name = "string"

Android: permission = "string"

Android: process = "string"

Android: readPermission = "string"

Android: syncable = ["true" | "false"]

Android: writePermission = "string">

...

</Provider>

Parent Element
<Application>

Child Element
<Meta-data>

<Grant-uri-permission>

<Path-permission>

Description
Declare the content provider component. Content provider is a subclass of ContentProvider, which provides structured access to data managed by applications. All content providers in the application must be declared through the <provider> element in the manifest file; otherwise, the system will not know and will not run it.

You can only define content provider as a part of your application. The content provider of other applications used in your application should not be defined.

The Android system stores a reference to the content provider based on the authority string, that is, the content URI of the provider. For example, you want to access the health care professional information through content provider. To do this, you need to call the ContentResolver. query () method. In this method, apart from other parameters, you also need to pass the URI that identifies this provider:

Content: // com. example. project. healthcareprovider/nurses/rn

This content: scheme indicates that this URI will point to the Android content provider as the content URI. Authoritycom. example. project. healthcareprovider indicates the provider itself. Then, the Android system searches for the authority in their known providers and authorities lists. The substring nurses/rn is the path, and the content provider uses it to identify the subset of the provider's data.

Note: When you define your provider in the <provider> element, you do not need to include this scheme or path in the android: name parameter, but only need authority.

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.