Chapter    27

Exploring the Contacts API

In Chapters 25 and 26, we covered content providers and their close cousins, the loaders. We listed the benefits of exposing data through content provider abstraction. In a content provider abstraction, data is exposed as a series of URLs. These data URLs can be used to read, query, update, insert, and delete. These URLs and their corresponding cursors become the API for that content provider.

The Contacts API is one such content provider API for working with contact data. Contacts in Android are maintained in a database and exposed through a content provider whose authority is rooted at

content://com.android.contacts

The Android SDK documents the various URLs and the data they return using a set of Java ...

Get Pro Android 5, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.