MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology


Type of Android Component: ContentProvider
Previous Home Next

Data is available to all application. ContentProvider usually the backend is SQLite. They are loosely linked to clients

ContentProvider are object that can

  • retrieve data
  • store data


You can think of content providers as a database server. A content provider's job is to manage access to persisted data, such as a SQLite database. there's no common storage area that all Android packages can access.

If your application is very simple, you might not necessarily create a content provider. If you're building a larger application, or one that makes data available to multiple activities or applications, a content provider is the means of accessing your data.A content provider is implemented as a subclass of ContentProvider. We can modify the data with the help of ContentProvider.

public abstract class ContentProvider extends Object implements ComponentCallbacks

Note : Content providers are also useful for reading and writing data that is private to your application and not shared. if you want to share data. You have two options:

  1. You can create your own content provider and extends the ContentProvider class
  2. You can add the data to an existing provider and gives permission to write to it.

Creating a Content Provider :

Firstly, you will set up a system for storing the data. You can store your data any way you want in SQLite database . SQLiteOpenHelper class is helpful for creation of a database and SQLiteDatabase to manage it.

This class extend the ContentProvider class to provide access to the data and must be declare in AndroidManifest.xml.

Content providers encapsulate data and provide it to applications through the single ContentResolver interface. The client use indirectly the ContentResolver object.You get a ContentResolver by calling getContentResolver() from within the implementation of an Activity or other application component.

The system inspects the authority of the given URI when a request is made via a ContentResolver and after that passing the request to the content provider registered with the authority. The UriMatcher class is very useful class for parsing URIs.

Previous Home Next