Struct android_manifest::QueriesProvider[][src]

pub struct QueriesProvider {
    pub authorities: AttributeList<Semicolon, String>,
}
Expand description

Declares a content provider component used in <queries>.

A content provider is a subclass of ContentProvider that 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.

You only declare content providers that are part of your application. Content providers in other applications that you use in your application should not be declared.

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 among other arguments takes a URI that identifies the provider:

XML Example

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

The content: scheme identifies the URI as a content URI pointing to an Android content provider. The authority com.example.project.healthcareprovider identifies the provider itself; the Android system looks up the authority in its list of known providers and their authorities. The substring nurses/rn is a path, which the content provider can use to identify subsets of the provider data.

In cases where you need to query a content provider but don’t know the specific package names, you can declare that provider authority in a element, as shown in the following snippet:

XML Example

<manifest package="com.example.suite.enterprise">
    <queries>
        <provider android:authorities="com.example.settings.files" />
    </queries>
   ...
</manifest>

Node

If your element includes a element, you might see an editor warning in Android Studio related to the element. As long as you’re using the latest “dot” release of the Android Gradle plugin, your build is unaffected, so you can disregard the warning. Learn more in the blog post about Preparing your Gradle build for package visibility in Android 11.

Contained in

Introduced in

API Level 30

Fields

authorities: AttributeList<Semicolon, String>

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 should use a Java-style naming convention (such as com.example.provider.cartoonprovider). Typically, it’s the name of the ContentProvider subclass that implements the provider

There is no default. At least one authority must be specified.

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.