On the use of Android content provider

Content provider: a component, which must be placed under the main package or sub package of the application;

The configuration of components needs to be configured in the list file; The content provider needs to be configured in the application node; The role of content providers in applications is to share data (any type of data) externally. Other programs can crud the data, such as address book; If you share data by file, you will need to use different API access methods because of different file types, resulting in complex access, and the content provider provides a unified API to operate the data< provider   android:name=".PersonProvider"<!-- Name of content provider class -- > Android: authorities = "CN. Wordtech. Providers. Personprovider"

  android:exported="false" ><!-- Solve Android permission denial error!, This item needs to be configured when listening for changes in content provider data -- > < / provider >

Another: Android: Authorities: specify a unique identifier for the content provider so that other applications can uniquely obtain this provider; Uri represents the data to be operated; Uri mainly contains two parts of information: 1 > > the ContentProvider to be operated, and 2 > > what data in the ContentProvider to be operated

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>