WHAT'S IN THIS CHAPTER?
Creating databases and using SQLite
Using Content Providers to share application data
Querying Content Providers
Using Cursors and Content Values to read and write from and to Content Providers
Database design considerations
Introduction to the native Content Providers
Using the Contact Content Provider
In this chapter you'll be introduced to the SQLite library, and you'll look at how to use Content Providers to share and use structured data within and between applications.
SQLite offers a powerful SQL database library that provides a robust persistence layer over which you have total control.
Content Providers offer a generic interface to any data source by decoupling the data storage layer from the application layer.
By default, access to a database is restricted to the application that created it. Content Providers offer a standard interface your applications can use to share data with and consume data from other applications — including many of the native data stores.
Structured data persistence in Android is provided through the following mechanisms:
SQLite Databases When managed, structured data is the best approach, Android offers the SQLite relational database library. Every application can create its own databases over which it has complete control.
Content Providers Content Providers offer a generic, well-defined interface for using and sharing data.
Using SQLite ...