Android content providers-create content providers (elements)

Source: Internet
Author: User

Like the activity and service components, the contentprovider subclass must be defined using the <provider> element in its Application List file. The Android system obtains the following information from this element:

1. Authorization (Android: Authorities)

The identifier of the entire provider in the system.

2. Provides the class name (Android: name)

This class implements the contentprovider abstract class.

3. Permission

Attribute that specifies the permissions required for other applications to access the data of the provider:

A. Android. granturipermssions: Temporary Permission ID;

B. Android. Permission: Read and Write Permissions within a single provider range;

C. Android. readpermission: Provides the read permission for the range of devices;

D. Android. writepermission: Provides write permission for the range of devices.

Permissions and their corresponding attributes are described in detail in the "implement content providers' Permissions" section.

Enable and control attributes

The following attributes determine how the Android system starts the provisioner, the processing features of the provisioner, and other runtime settings:

1. Android: enabled: Indicates whether to allow the system to start the provider;

2. Android: exported: whether other applications are allowed to use the identifier of this provider;

3. Android: initorder: The Starting sequence of the provider relative to that of other providers in the same process.

4. Android: Multiprocess: whether to allow the provider to start in the same process as the client that calls it;

5. Android: Process: name of the process that the provider should run;

6. Android: syncable: indicates whether the provider's data must be synchronized with the server's data.

These attributes are described in the topic of the <provider> element Development Guide.

Information attributes

An optional icon and tag for the provisioner:

1. Android: icon: contains the resource icons that can be traced by the provider. This icon is displayed next to the provisioner tag in the Application List of setting> apps> All.

2. Android: Label: An information label that describes the provider or its data. This label is displayed in the Application List of setting> apps> All.

These attributes are described in the topic of the <provider> element Development Guide.

Related Article

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: 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.