- syntax:
-
<provider android:authorities="list" android:directBootAware=["true" | "false"] android:enabled=["true" | "false"] android:exported=["true" | "false"] android:grantUriPermissions=["true" | "false"] android:icon="drawable resource" android:initOrder="integer" android:intentMatchingFlags=["none" | "enforceIntentFilter" | "allowNullAction"] 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>
- contained in:
-
<application> - can contain:
<meta-data><grant-uri-permission><intent-filter><path-permission><property>- description:
-
Declares a content provider component. A content provider is a subclass of
ContentProviderthat supplies structured access to data managed by the application. All content providers in your application must be defined in a<provider>element in the manifest file. Otherwise, the system is unaware of them and doesn't run them.Only declare content providers that are part of your application. Don't declare content providers in other applications that you use in your application.
The Android system stores references to content providers according to an authority string, part of the provider's content URI. For example, suppose you want to access a content provider that stores information about health care professionals. To do this, you call the method
ContentResolver.query(), which takes a URI that identifies the provider, among other arguments:content://com.example.project.healthcareprovider/nurses/rn
The
content:scheme identifies the URI as a content URI pointing to an Android content provider. The authoritycom.example.project.healthcareprovideridentifies the provider itself. The Android system looks up the authority in its list of known providers and their authorities. The substringnurses/rnis a path, which the content provider uses to identify subsets of the provider data.When you define your provider in the
<provider>element, you don't include the scheme or the path in theandroid:nameargument, only the authority.For information about using and developing content providers, see Content providers.
- attributes:
-
android:authorities-
A list of one or more URI authorities that identify data offered by the content provider.
List multiple authorities by separating their names with a semicolon.
To avoid conflicts, use a Java-style naming convention for authority names,
such as
com.example.provider.cartoonprovider. Typically, it's the name of theContentProvidersubclass that implements the providerThere is no default. At least one authority must be specified.
android:enabled- Whether the content provider can be instantiated by the system. It's
"true"if it can be, and"false"if not. The default value is"true".The
<application>element has its ownenabledattribute that applies to all application components, including content providers. The<application>and<provider>attributes both have to be"true", as they both are by default, for the content provider to be enabled. If either is"false", the provider is disabled. It can't be instantiated. android:directBootAwareWhether the content provider is Direct-Boot aware—that is, whether it can run before the user unlocks the device.
Note: During Direct Boot, a content provider in your application can only access the data that is stored in device protected storage.
The default value is
"false".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 isn't 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, or applications that are temporarily granted access to the provider through theandroid:grantUriPermissionselement, have access to it.
Because this attribute was introduced in API level 17, all devices running API level 16 and lower behave as though this attribute is set
"true". If you setandroid:targetSdkVersionto 17 or higher, then the default value is"false"for devices running API level 17 and higher.You can set
android:exported="false"and still limit access to your provider by setting permissions with thepermissionattribute. -
android:grantUriPermissionsWhether those who ordinarily don't have permission to access the content provider's data can be granted permission to do so, temporarily overcoming the restriction imposed by the
readPermission,writePermission,permission, andexportedattributes.It's
"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 email message contains an attachment, the mail application might call on 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 granted by
FLAG_GRANT_READ_URI_PERMISSIONandFLAG_GRANT_WRITE_URI_PERMISSIONflags in theIntentobject that activates the component. For example, the mail application might putFLAG_GRANT_READ_URI_PERMISSIONin theIntentpassed toContext.startActivity(). The permission is specific to the URI in theIntent.If you enable this feature, either by setting this attribute to
"true"or by defining<grant-uri-permission>subelements, callContext.revokeUriPermission()when a covered URI is deleted from the provider.See also the
<grant-uri-permission>element.android:icon- An icon representing the content provider.
This attribute is set as a reference to a drawable resource containing
the image definition. If it isn't set, the icon specified for the application
as a whole is used instead. For more information, see the
<application>element'siconattribute. android:initOrder- The order in which the content provider is 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 makes sure that they are created in the order required by those dependencies. The value is an integer, with higher numbers being initialized first.
android:intentMatchingFlags-
Use this attribute to fine-tune how the system matches incoming intents to app components. By default, no special matching rules are applied.
The value set on a
<provider>tag overrides the value set on the<application>tag.The value must be one or more of the following flags, separated by '
|':Flag Description noneDisables all special matching rules for incoming intents. When specifying multiple flags, conflicting values are resolved by giving precedence to the noneflag.enforceIntentFilterEnforces stricter matching for incoming intents:
- Explicit intents must match the target component's intent filter.
- Intents without an action don't match any intent filter.
allowNullActionRelaxes the matching rules to allow intents without an action to match. This flag is used in conjunction with
enforceIntentFilterto achieve the following behavior:- Explicit intents must match the target component's intent filter.
- Intents without an action are allowed to match any intent filter.
For more information, see the Safer Intents section in the Android 16 (API level 36) behavior changes.
android:label- A user-readable label for the content provided.
If this attribute isn't set, the label set for the application as a whole is
used instead. For more information, see the
<application>element'slabelattribute.The label is usually set as a reference to a string resource, so that it 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- If the app runs in multiple processes, this attribute determines whether
multiple instances of the content provider are created. If
"true", each of the app's processes has its own content provider object. If"false", the app's processes share only one content provider object. The default value is"false".Setting this flag to
"true"can improve performance by reducing the overhead of interprocess communication, but it also increases the memory footprint of each process. android:name- The name of the class that implements the content provider, a subclass of
ContentProvider. This is usually a fully qualified class name, such as"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 the<manifest>element.There is no default. The name must be specified.
android:permissionThe name of a permission that clients must have to read or write the content provider's data. This attribute is a convenient way of setting a single permission for both reading and writing. However, the
readPermission,writePermission, andgrantUriPermissionsattributes take precedence over this one.If the
readPermissionattribute is also set, it controls access for querying the content provider. If thewritePermissionattribute is set, it controls access for modifying the provider's data.For more information about permissions, see the Permissions section in the app manifest overview and Security tips.
android:processThe name of the process in which the content provider runs. 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'sprocessattribute can set a different default for all components. But each component can override the default with its ownprocessattribute, letting you spread your application across 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 runs in a global process of that name, provided that it has permission to do so. This lets components in different applications share a process, reducing resource usage.
android:readPermissionA permission that clients must have to query the content provider.
If the provider sets
android:grantUriPermissionsto"true", or if a given client satisfies the conditions of a<grant-uri-permission>subelement, the client can gain temporary read access to the content provider's data.See also the
permissionandwritePermissionattributes.android:syncable- Whether the data under the content provider's control
can be synchronized with data on a server. It's
"true"if it can be, and"false"if not. android:writePermissionA permission that clients need to make changes to the data controlled by the content provider.
If the provider sets
android:grantUriPermissionsto"true", or if a given client satisfies the conditions of a<grant-uri-permission>subelement, the client can gain temporary write access to modify the content provider's data.See also the
permissionandreadPermissionattributes.
- introduced in:
- API level 1
- see also:
- Content providers
<provider>
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-07-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-07-01 UTC."],[],[]]