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.