1.

How would you access data in a ContentProvider?

Answer»

In Android when we WANT to share data between two applications we are using Content Provider. It has a complete mechanism to share data between applications. It will also provide security while sharing data from one application to another application. For getting data from any Content Provider you need to create Content Resolver. For Creating Content Resolver, you need to call ACTIVITY’s getContentResolver method.

For Modifying data from Content Provider, you can invoke the basic method of Content Resolver like insert, delete, update and query. These operations are the same as the SQLite DB Operation.

Android we have two steps for RETRIEVING data from a Content Provider:

  • Write-read permission for READING data from Content Provider
  • Write a query to send a request to the content provider.


Discussion

No Comment Found

Related InterviewSolutions