Content providers store and retrieve data and make it accessible to all applications. They are the only way to share data across applications; there is no common storage area that all Android packages can access.
We will start by creating our own.
The work to do is to create an application called SongProvider which exposes the countries, artists and songs database by implementing a Content Provider. Then, a second application called SongConsumer will have to be written (pictured above) which, when run, allows the user to query the database as well as update the title of selected songs.
Android also has a number of built-in providers for the data stored on the phone: e.g. contacts, call logs, media files and settings.
The work to do is to develop ShowContacts, an application which displays all contacts with their phone numbers. In Android, contacts are stored in a very subtle way and ContactsContract is the class to use to access and manipulate contacts.



Recent Comments