Skip to content

Most visited

Recently visited


Accessing Contacts Data

Dependencies and prerequisites

  • Android 2.0 (API Level 5) or higher
  • Experience in using Intent objects
  • Experience in using content providers

You should also read

Try it out

Download the sample

The Contacts Provider is the central repository of the user's contacts information, including data from contacts apps and social networking apps. In your apps, you can access Contacts Provider information directly by calling ContentResolver methods or by sending intents to a contacts app.

This class focuses on retrieving lists of contacts, displaying the details for a particular contact, and modifying contacts using intents. The basic techniques described here can be extended to perform more complex tasks. In addition, this class helps you understand the overall structure and operation of the Contacts Provider.


Retrieving a List of Contacts
Learn how to retrieve a list of contacts for which the data matches all or part of a search string, using the following techniques:
  • Match by contact name
  • Match any type of contact data
  • Match a specific type of contact data, such as a phone number
Retrieving Details for a Contact
Learn how to retrieve the details for a single contact. A contact's details are data such as phone numbers and email addresses. You can retrieve all details, or you can retrieve details of a specific type, such as all email addresses.
Modifying Contacts Using Intents
Learn how to modify a contact by sending an intent to the People app.
Displaying the Quick Contact Badge
Learn how to display the QuickContactBadge widget. When the user clicks the contact badge widget, a dialog opens that displays the contact's details and action buttons for apps that can handle the details. For example, if the contact has an email address, the dialog displays an action button for the default email app.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


WeChat에서 Google Developers 팔로우하기

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)