Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between contentprovider and contentResolver in android

What is the difference between ContentProviders and ContentResolver? I do not want for the SQLite database. I am developing an application for media.

like image 212
Akshay Mukadam Avatar asked Sep 18 '13 14:09

Akshay Mukadam


People also ask

What is ContentResolver in Android?

The Content Resolver behaves exactly as its name implies: it accepts requests from clients, and resolves these requests by directing them to the content provider with a distinct authority. To do this, the Content Resolver stores a mapping from authorities to Content Providers.

How many ContentProvider Can an app have?

You can implement as many as you want, as you can see from the documentation here. To register a content provider, you need to add its corresponding <provider> tag in the Android Manifest. In most cases, however, you won't need multiple content providers. One is usually enough, as it can handle multiple tables.

What is the purpose of content provider class in Android?

Content providers can help an application manage access to data stored by itself, stored by other apps, and provide a way to share data with other apps. They encapsulate the data, and provide mechanisms for defining data security.


1 Answers

I found some explanation here. In summary

Content Resolver resolves a URI to a specific Content provider.

Content Provider provides an interface to query content.

The way to query a content provider is contentResolverInstance.query(URI,.....)

like image 69
user1700184 Avatar answered Sep 25 '22 20:09

user1700184