Cover by Reto Meier

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Chapter 8

Databases and Content Providers

What's in this Chapter?

Creating databases and using SQLite

Using Content Providers, Cursors, and Content Values to store, share, and consume application data

Asynchronously querying Content Providers using Cursor Loaders

Adding search capabilities to your applications

Using the native Media Store, Contacts, and Calendar Content Providers

This chapter introduces persistent data storage in Android, starting with the SQLite database library. SQLite offers a powerful SQL database library that provides a robust persistence layer over which you have total control.

You'll also learn how to build and use Content Providers to store, share, and consume structured data within and between applications. Content Providers offer a generic interface to any data source by decoupling the data storage layer from the application layer. You'll see how to query Content Providers asynchronously to ensure your application remains responsive.

Although 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.

Having created an application with data to store, you'll learn how to add search functionality to your application and how to build Content Providers that can provide real-time search suggestions.

Because Content Providers can be used across application boundaries, you have ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required