-
android:authorities
-
A list of one or more URI authorities that identify data offered by the content provider. multiple authorities are listed by separating their names with a semicolon. to avoid conflicts, authority names shocould use a Java-style naming convention (such
com.example.provider.cartoonprovider
). Typically, it's the name of
ContentProvider
Subclass that implements the provider
There is no default. At least one authority must be specified.
-
android:enabled
-
Whether or not the content provider can be instantiated by the system -"
true
"If it can be, and"
false
"If not. The default value is"
true
".
The<application>
Element has its ownenabled
Attribute that applies to all application components, including content providers.<application>
And<provider>
Attributes must both be"true
"(As they bothare by default) for the content provider to be enabled. If either is"false
", The provider is disabled; it cannot be instantiated.
-
android:exported
-
Whether the content provider is available for other applications to use:
-
true
: The provider is available to other applications. Any application can use the provider's content URI to access it, subject to the permissions specified for the provider.
-
false
: The provider is not available to other applications. Setandroid:exported="false"
To limit access to the provider to your applications. Only applications that have the same user ID (UID) as the provider will have access to it.
The default value is"true"
For applications that set eitherandroid:minSdkVersion
Orandroid:targetSdkVersion
To"16"
Or lower. For applications that set either of these attributes"17"
Or higher, the default is"false"
.
You can setandroid:exported="false"
And still limit access to your provider by setting permissions withpermission
Attribute.
-
android:grantUriPermissions
-
Whether or not those who ordinarily wocould not have permission to access the content provider's data can be granted permission to do so, temporarily overcoming the restriction imposed by
readPermission
,
writePermission
, And
permission
Attributes -"
true
"If permission can be granted, and"
false
"If not. If"
true
", Permission can be granted to any of the content provider's data. If"
false
", Permission can be granted only to the data subsets listed in
<grant-uri-permission>
Subelements, if any. The default value is"
false
".
Granting permission is a way of giving an application component one-time access to data protected by a permission. for example, when an e-mail message contains an attachment, the mail application may call upon the appropriate viewer to open it, even though the viewer doesn't have general permission to look at all the content provider's data.
In such cases, permission is grantedFLAG_GRANT_READ_URI_PERMISSION
AndFLAG_GRANT_WRITE_URI_PERMISSION
Flags in the Intent object that activates the component. For example, the mail application might putFLAG_GRANT_READ_URI_PERMISSION
In the Intent passedContext.startActivity()
. The permission is specific to the URI in the Intent.
If you enable this feature, either by setting this attribute"true
"Or by defining<grant-uri-permission>
Subelements, you must callContext.revokeUriPermission()
When a covered URI is deleted from the provider.
See also<grant-uri-permission>
Element.
-
android:icon
-
An icon representing the content provider. this attribute must be set as a reference to a drawable resource containing the image definition. if it is not set, the icon specified for the application as a whole is used instead (see
<application>
Element's
icon
Attribute ).
-
android:initOrder
-
The order in which the content provider shoshould be instantiated, relative to other content providers hosted by the same process. when there are dependencies among content providers, setting this attribute for each of them ensures that they are created in the order required by those dependencies. the value is a simple integer, with higher numbers being initialized first.
-
android:label
-
A user-readable label for the content provided. If this attribute is not set, the label set for the application as a whole is used instead (see
<application>
Element's
label
Attribute ).
The label shoshould be set as a reference to a string resource, so thatit can be localized like other strings in the user interface. however, as a convenience while you're developing the application, it can also be set as a raw string.
-
android:multiprocess
-
Whether or not an instance of the content provider can be created in every client process -"
true
"If instances can run in multipleprocesses, and"
false
"If not. The default value is"
false
".
Normally, a content provider is instantiated in the process of the application that defined it. However, if this flag is set"true
", The system can create an instance in every process where there's a client that wants to interact with it, thus avoiding the overhead of interprocess communication.
-
android:name
-
The name of the class that implements the content provider, a subclass
ContentProvider
. This shoshould be a fully qualified class name (such ,"
com.example.project.TransportationProvider
"). However, as a shorthand, if the first character of the name is a period, it is appended to the package name specified in
<manifest>
Element.
There is no default. The name must be specified.
-
android:permission
-
The name of a permission that clients must have to read or write thecontent provider's data. This attribute is a convenient way of setting a single permission for both reading and writing. However,
readPermission
And
writePermission
Attributes take precedenceover this one. If
readPermission
Attribute is also set, it controls access for querying the content provider. And if
writePermission
Attribute is set, it controls access for modifying the provider's data.
For more information on permissions, see the Permissions section in the introduction and a separate document, Security andPermissions.
-
android:process
-
The name of the process in which the content provider shocould run. normally, all components of an application run in the default process created for the application. it has the same name as the application package. the
<application>
Element's
process
Attribute can set a different default for all components. But each component can override the defaultwith its own
process
Attribute, allowing you to spread your application processing SS multiple processes.
If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when it's needed and the activity runs in that process. if the process name begins with a lowercase character, the activity will run in a global process of that name, provided that it has permission to do so. this allows components in different applications to share a process, cing resource usage.
-
android:readPermission
-
A permission that clients must have to query the content provider. See also
permission
And
writePermission
Attributes.
-
android:syncable
-
Whether or not the data under the content provider's control is to be synchronized with data on a server -"
true
"If it is to be synchronized, and"
false
"If not.
-
android:writePermission
-
A permission that clients must have to make changes to the data controlled by the content provider. See also
permission
And
readPermission
Attributes.