# ContactsContract

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary: [Nested Classes](https://developer.android.com/reference/android/provider/ContactsContract#nestedclasses) \| [Constants](https://developer.android.com/reference/android/provider/ContactsContract#constants) \| [Fields](https://developer.android.com/reference/android/provider/ContactsContract#lfields) \| [Ctors](https://developer.android.com/reference/android/provider/ContactsContract#pubctors) \| [Methods](https://developer.android.com/reference/android/provider/ContactsContract#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/provider/ContactsContract#inhmethods)  

# ContactsContract

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/provider/ContactsContract "View this page in Kotlin") \|Java


`
public

final

class
ContactsContract
`


`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


`

`


`

|---|-----------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.provider.ContactsContract |

<br />

*** ** * ** ***

<br />


The contract between the contacts provider and applications. Contains
definitions for the supported URIs and columns. These APIs supersede
[Contacts](https://developer.android.com/reference/android/provider/ContactsContract.Contacts).

### Overview


ContactsContract defines an extensible database of contact-related
information. Contact information is stored in a three-tier data model:

- A row in the [Data](https://developer.android.com/reference/android/provider/ContactsContract.Data) table can store any kind of personal data, such as a phone number or email addresses. The set of data kinds that can be stored in this table is open-ended. There is a predefined set of common kinds, but any application can add its own data kinds.
- A row in the [RawContacts](https://developer.android.com/reference/android/provider/ContactsContract.RawContacts) table represents a set of data describing a person and associated with a single account (for example, one of the user's Gmail accounts).
- A row in the [Contacts](https://developer.android.com/reference/android/provider/ContactsContract.Contacts) table represents an aggregate of one or more RawContacts presumably describing the same person. When data in or associated with the RawContacts table is changed, the affected aggregate contacts are updated as necessary.


Other tables include:

- [Groups](https://developer.android.com/reference/android/provider/ContactsContract.Groups), which contains information about raw contact groups such as Gmail contact groups. The current API does not support the notion of groups spanning multiple accounts.
- [StatusUpdates](https://developer.android.com/reference/android/provider/ContactsContract.StatusUpdates), which contains social status updates including IM availability.
- [AggregationExceptions](https://developer.android.com/reference/android/provider/ContactsContract.AggregationExceptions), which is used for manual aggregation and disaggregation of raw contacts
- [Settings](https://developer.android.com/reference/android/provider/ContactsContract.Settings), which contains visibility and sync settings for accounts and groups.
- [SyncState](https://developer.android.com/reference/android/provider/ContactsContract.SyncState), which contains free-form data maintained on behalf of sync adapters
- [PhoneLookup](https://developer.android.com/reference/android/provider/ContactsContract.PhoneLookup), which is used for quick caller-ID lookup

<br />

## Summary

|                                                                                                                                                                                                                                          ### Nested classes                                                                                                                                                                                                                                           ||
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class`     | [ContactsContract.AggregationExceptions](https://developer.android.com/reference/android/provider/ContactsContract.AggregationExceptions) <br /> Constants for the contact aggregation exceptions table, which contains aggregation rules overriding those used by automatic aggregation.                                                                                                                                                                                               |
| ` interface` | [ContactsContract.BaseSyncColumns](https://developer.android.com/reference/android/provider/ContactsContract.BaseSyncColumns) Generic columns for use by sync adapters.                                                                                                                                                                                                                                                                                                                 |
| ` class`     | [ContactsContract.CommonDataKinds](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds) Container for definitions of common data types stored in the [ContactsContract.Data](https://developer.android.com/reference/android/provider/ContactsContract.Data) table.                                                                                                                                                                               |
| ` interface` | [ContactsContract.ContactNameColumns](https://developer.android.com/reference/android/provider/ContactsContract.ContactNameColumns) Contact name and contact name metadata columns in the RawContacts table.                                                                                                                                                                                                                                                                            |
| ` interface` | [ContactsContract.ContactOptionsColumns](https://developer.android.com/reference/android/provider/ContactsContract.ContactOptionsColumns) Columns of [ContactsContract.Contacts](https://developer.android.com/reference/android/provider/ContactsContract.Contacts) that track the user's preferences for, or interactions with, the contact.                                                                                                                                          |
| ` interface` | [ContactsContract.ContactStatusColumns](https://developer.android.com/reference/android/provider/ContactsContract.ContactStatusColumns)                                                                                                                                                                                                                                                                                                                                                 |
| ` class`     | [ContactsContract.Contacts](https://developer.android.com/reference/android/provider/ContactsContract.Contacts) Constants for the contacts table, which contains a record per aggregate of raw contacts representing the same person.                                                                                                                                                                                                                                                   |
| ` interface` | [ContactsContract.ContactsColumns](https://developer.android.com/reference/android/provider/ContactsContract.ContactsColumns) Columns of [ContactsContract.Contacts](https://developer.android.com/reference/android/provider/ContactsContract.Contacts) that refer to intrinsic properties of the contact, as opposed to the user-specified options found in [ContactOptionsColumns](https://developer.android.com/reference/android/provider/ContactsContract.ContactOptionsColumns). |
| ` class`     | [ContactsContract.Data](https://developer.android.com/reference/android/provider/ContactsContract.Data) <br /> Constants for the data table, which contains data points tied to a raw contact.                                                                                                                                                                                                                                                                                          |
| ` interface` | [ContactsContract.DataColumns](https://developer.android.com/reference/android/provider/ContactsContract.DataColumns) Columns in the Data table.                                                                                                                                                                                                                                                                                                                                        |
| ` interface` | [ContactsContract.DataColumnsWithJoins](https://developer.android.com/reference/android/provider/ContactsContract.DataColumnsWithJoins) Combines all columns returned by [ContactsContract.Data](https://developer.android.com/reference/android/provider/ContactsContract.Data) table queries.                                                                                                                                                                                         |
| ` class`     | [ContactsContract.DataUsageFeedback](https://developer.android.com/reference/android/provider/ContactsContract.DataUsageFeedback) *This class was deprecated in API level 29. Contacts affinity information is no longer supported as of Android version [Build.VERSION_CODES.Q](https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q). Both update and delete calls are always ignored.*                                                                           |
| ` interface` | [ContactsContract.DataUsageStatColumns](https://developer.android.com/reference/android/provider/ContactsContract.DataUsageStatColumns) Columns in the Data_Usage_Stat table                                                                                                                                                                                                                                                                                                            |
| ` class`     | [ContactsContract.DeletedContacts](https://developer.android.com/reference/android/provider/ContactsContract.DeletedContacts) Constants for the deleted contact table.                                                                                                                                                                                                                                                                                                                  |
| ` interface` | [ContactsContract.DeletedContactsColumns](https://developer.android.com/reference/android/provider/ContactsContract.DeletedContactsColumns)                                                                                                                                                                                                                                                                                                                                             |
| ` class`     | [ContactsContract.Directory](https://developer.android.com/reference/android/provider/ContactsContract.Directory) A Directory represents a contacts corpus, e.g. Local contacts, Google Apps Global Address List or Corporate Global Address List.                                                                                                                                                                                                                                      |
| ` interface` | [ContactsContract.DisplayNameSources](https://developer.android.com/reference/android/provider/ContactsContract.DisplayNameSources) Types of data used to produce the display name for a contact.                                                                                                                                                                                                                                                                                       |
| ` class`     | [ContactsContract.DisplayPhoto](https://developer.android.com/reference/android/provider/ContactsContract.DisplayPhoto) Helper class for accessing full-size photos by photo file ID.                                                                                                                                                                                                                                                                                                   |
| ` interface` | [ContactsContract.FullNameStyle](https://developer.android.com/reference/android/provider/ContactsContract.FullNameStyle) Constants for various styles of combining given name, family name etc into a full name.                                                                                                                                                                                                                                                                       |
| ` class`     | [ContactsContract.Groups](https://developer.android.com/reference/android/provider/ContactsContract.Groups) Constants for the groups table.                                                                                                                                                                                                                                                                                                                                             |
| ` interface` | [ContactsContract.GroupsColumns](https://developer.android.com/reference/android/provider/ContactsContract.GroupsColumns)                                                                                                                                                                                                                                                                                                                                                               |
| ` class`     | [ContactsContract.Intents](https://developer.android.com/reference/android/provider/ContactsContract.Intents) Contains helper classes used to create or manage [Intents](https://developer.android.com/reference/android/content/Intent) that involve contacts.                                                                                                                                                                                                                         |
| ` class`     | [ContactsContract.PhoneLookup](https://developer.android.com/reference/android/provider/ContactsContract.PhoneLookup) A table that represents the result of looking up a phone number, for example for caller ID.                                                                                                                                                                                                                                                                       |
| ` interface` | [ContactsContract.PhoneLookupColumns](https://developer.android.com/reference/android/provider/ContactsContract.PhoneLookupColumns)                                                                                                                                                                                                                                                                                                                                                     |
| ` interface` | [ContactsContract.PhoneticNameStyle](https://developer.android.com/reference/android/provider/ContactsContract.PhoneticNameStyle) Constants for various styles of capturing the pronunciation of a person's name.                                                                                                                                                                                                                                                                       |
| ` class`     | [ContactsContract.PinnedPositions](https://developer.android.com/reference/android/provider/ContactsContract.PinnedPositions) <br /> Contact-specific information about whether or not a contact has been pinned by the user at a particular position within the system contact application's user interface.                                                                                                                                                                           |
| ` class`     | [ContactsContract.Presence](https://developer.android.com/reference/android/provider/ContactsContract.Presence) *This class was deprecated in API level 5. This old name was never meant to be made public. Do not use.*                                                                                                                                                                                                                                                                |
| ` interface` | [ContactsContract.PresenceColumns](https://developer.android.com/reference/android/provider/ContactsContract.PresenceColumns) Additional data mixed in with [StatusColumns](https://developer.android.com/reference/android/provider/ContactsContract.StatusColumns) to link back to specific [ContactsContract.Data._ID](https://developer.android.com/reference/android/provider/BaseColumns#_ID) entries.                                                                            |
| ` class`     | [ContactsContract.Profile](https://developer.android.com/reference/android/provider/ContactsContract.Profile) <br /> Constants for the user's profile data, which is represented as a single contact on the device that represents the user.                                                                                                                                                                                                                                            |
| ` class`     | [ContactsContract.ProfileSyncState](https://developer.android.com/reference/android/provider/ContactsContract.ProfileSyncState) A table provided for sync adapters to use for storing private sync state data for the user's personal profile.                                                                                                                                                                                                                                          |
| ` class`     | [ContactsContract.ProviderStatus](https://developer.android.com/reference/android/provider/ContactsContract.ProviderStatus) API for inquiring about the general status of the provider.                                                                                                                                                                                                                                                                                                 |
| ` class`     | [ContactsContract.QuickContact](https://developer.android.com/reference/android/provider/ContactsContract.QuickContact) Helper methods to display QuickContact dialogs that display all the information belonging to a specific [Contacts](https://developer.android.com/reference/android/provider/ContactsContract.Contacts) entry.                                                                                                                                                   |
| ` class`     | [ContactsContract.RawContacts](https://developer.android.com/reference/android/provider/ContactsContract.RawContacts) Constants for the raw contacts table, which contains one row of contact information for each person in each synced account.                                                                                                                                                                                                                                       |
| ` interface` | [ContactsContract.RawContactsColumns](https://developer.android.com/reference/android/provider/ContactsContract.RawContactsColumns)                                                                                                                                                                                                                                                                                                                                                     |
| ` class`     | [ContactsContract.RawContactsEntity](https://developer.android.com/reference/android/provider/ContactsContract.RawContactsEntity) <br /> Constants for the raw contacts entities table, which can be thought of as an outer join of the raw_contacts table with the data table.                                                                                                                                                                                                         |
| ` class`     | [ContactsContract.SearchSnippets](https://developer.android.com/reference/android/provider/ContactsContract.SearchSnippets) Additional column returned by [Contacts.CONTENT_FILTER_URI](https://developer.android.com/reference/android/provider/ContactsContract.Contacts#CONTENT_FILTER_URI) explaining why the filter matched the contact.                                                                                                                                           |
| ` class`     | [ContactsContract.Settings](https://developer.android.com/reference/android/provider/ContactsContract.Settings) <br /> Contacts-specific settings for various [Account](https://developer.android.com/reference/android/accounts/Account)'s.                                                                                                                                                                                                                                            |
| ` interface` | [ContactsContract.SettingsColumns](https://developer.android.com/reference/android/provider/ContactsContract.SettingsColumns)                                                                                                                                                                                                                                                                                                                                                           |
| ` class`     | [ContactsContract.SimAccount](https://developer.android.com/reference/android/provider/ContactsContract.SimAccount) A parcelable class encapsulating account data for contacts that originate from a SIM card.                                                                                                                                                                                                                                                                          |
| ` class`     | [ContactsContract.SimContacts](https://developer.android.com/reference/android/provider/ContactsContract.SimContacts) Class containing utility methods around determine what accounts in the ContactsProvider are related to the SIM cards in the device.                                                                                                                                                                                                                               |
| ` interface` | [ContactsContract.StatusColumns](https://developer.android.com/reference/android/provider/ContactsContract.StatusColumns) Social status update columns.                                                                                                                                                                                                                                                                                                                                 |
| ` class`     | [ContactsContract.StatusUpdates](https://developer.android.com/reference/android/provider/ContactsContract.StatusUpdates) <br /> A status update is linked to a [ContactsContract.Data](https://developer.android.com/reference/android/provider/ContactsContract.Data) row and captures the user's latest status update via the corresponding source, e.g.                                                                                                                             |
| ` interface` | [ContactsContract.SyncColumns](https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns) Columns that appear when each row of a table belongs to a specific account, including sync information that an account may need.                                                                                                                                                                                                                                  |
| ` class`     | [ContactsContract.SyncState](https://developer.android.com/reference/android/provider/ContactsContract.SyncState) A table provided for sync adapters to use for storing private sync state data for contacts.                                                                                                                                                                                                                                                                           |

|                                                                                                                                                                                                                                                                                                                       ### Constants                                                                                                                                                                                                                                                                                                                        ||
|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | [AUTHORITY](https://developer.android.com/reference/android/provider/ContactsContract#AUTHORITY) The authority for the contacts provider                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [String](https://developer.android.com/reference/java/lang/String) | [CALLER_IS_SYNCADAPTER](https://developer.android.com/reference/android/provider/ContactsContract#CALLER_IS_SYNCADAPTER) An optional URI parameter for insert, update, or delete queries that allows the caller to specify that it is a sync adapter.                                                                                                                                                                                                                                                                                                                                  |
| [String](https://developer.android.com/reference/java/lang/String) | [DEFERRED_SNIPPETING](https://developer.android.com/reference/android/provider/ContactsContract#DEFERRED_SNIPPETING) A key to a boolean in the "extras" bundle of the cursor.                                                                                                                                                                                                                                                                                                                                                                                                          |
| [String](https://developer.android.com/reference/java/lang/String) | [DEFERRED_SNIPPETING_QUERY](https://developer.android.com/reference/android/provider/ContactsContract#DEFERRED_SNIPPETING_QUERY) Key to retrieve the original deferred snippeting from the cursor on the client side.                                                                                                                                                                                                                                                                                                                                                                  |
| [String](https://developer.android.com/reference/java/lang/String) | [DIRECTORY_PARAM_KEY](https://developer.android.com/reference/android/provider/ContactsContract#DIRECTORY_PARAM_KEY) Query parameter that should be used by the client to access a specific [Directory](https://developer.android.com/reference/android/provider/ContactsContract.Directory).                                                                                                                                                                                                                                                                                          |
| [String](https://developer.android.com/reference/java/lang/String) | [LIMIT_PARAM_KEY](https://developer.android.com/reference/android/provider/ContactsContract#LIMIT_PARAM_KEY) A query parameter that limits the number of results returned for supported URIs.                                                                                                                                                                                                                                                                                                                                                                                          |
| [String](https://developer.android.com/reference/java/lang/String) | [PRIMARY_ACCOUNT_NAME](https://developer.android.com/reference/android/provider/ContactsContract#PRIMARY_ACCOUNT_NAME) A query parameter specifing a primary account.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [String](https://developer.android.com/reference/java/lang/String) | [PRIMARY_ACCOUNT_TYPE](https://developer.android.com/reference/android/provider/ContactsContract#PRIMARY_ACCOUNT_TYPE) A query parameter specifing a primary account.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [String](https://developer.android.com/reference/java/lang/String) | [REMOVE_DUPLICATE_ENTRIES](https://developer.android.com/reference/android/provider/ContactsContract#REMOVE_DUPLICATE_ENTRIES) A boolean parameter for [Phone.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Phone#CONTENT_URI), [Email.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Email#CONTENT_URI), and [StructuredPostal.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#CONTENT_URI). |
| [String](https://developer.android.com/reference/java/lang/String) | [STREQUENT_PHONE_ONLY](https://developer.android.com/reference/android/provider/ContactsContract#STREQUENT_PHONE_ONLY) A boolean parameter for [Contacts.CONTENT_STREQUENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.Contacts#CONTENT_STREQUENT_URI) and [Contacts.CONTENT_STREQUENT_FILTER_URI](https://developer.android.com/reference/android/provider/ContactsContract.Contacts#CONTENT_STREQUENT_FILTER_URI), which requires the ContactsProvider to return only phone-related results.                                                      |

|                                                                                                                            ### Fields                                                                                                                             ||
|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[Uri](https://developer.android.com/reference/android/net/Uri) | [AUTHORITY_URI](https://developer.android.com/reference/android/provider/ContactsContract#AUTHORITY_URI) A content:// style uri to the authority for the contacts provider |

|                                                   ### Public constructors                                                   ||
|--------------------------------------------------------------------------------------------------------------------------|---|
| ` `[ContactsContract](https://developer.android.com/reference/android/provider/ContactsContract#ContactsContract())`() ` |

|                                                                                                           ### Public methods                                                                                                           ||
|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static boolean` | ` `[isProfileId](https://developer.android.com/reference/android/provider/ContactsContract#isProfileId(long))`(long id) ` This method can be used to identify whether the given ID is associated with profile data. |

| ### Inherited methods |
|-----------------------|---|
| From class ` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                        | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                             | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                            | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`.                                                                                                                                                 | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                   | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                              | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                           | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                              | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.                                                                                             | ||

## Constants

### AUTHORITY

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String AUTHORITY
```

The authority for the contacts provider

<br />

Constant Value:

"com.android.contacts"


### CALLER_IS_SYNCADAPTER

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String CALLER_IS_SYNCADAPTER
```

An optional URI parameter for insert, update, or delete queries
that allows the caller
to specify that it is a sync adapter. The default value is false. If true
[RawContacts.DIRTY](https://developer.android.com/reference/android/provider/ContactsContract.SyncColumns#DIRTY) is not automatically set and the
"syncToNetwork" parameter is set to false when calling
[ContentResolver.notifyChange(android.net.Uri, android.database.ContentObserver, boolean)](https://developer.android.com/reference/android/content/ContentResolver#notifyChange(android.net.Uri,%20android.database.ContentObserver,%20boolean)).
This prevents an unnecessary extra synchronization, see the discussion of
the delete operation in [RawContacts](https://developer.android.com/reference/android/provider/ContactsContract.RawContacts).

<br />

Constant Value:

"caller_is_syncadapter"


### DEFERRED_SNIPPETING

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String DEFERRED_SNIPPETING
```

A key to a boolean in the "extras" bundle of the cursor.
The boolean indicates that the provider did not create a snippet and that the client asking
for the snippet should do it (true means the snippeting was deferred to the client).

<br />

**See also:**

- [ContactsContract.SearchSnippets](https://developer.android.com/reference/android/provider/ContactsContract.SearchSnippets)

Constant Value:

"deferred_snippeting"


### DEFERRED_SNIPPETING_QUERY

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String DEFERRED_SNIPPETING_QUERY
```

Key to retrieve the original deferred snippeting from the cursor on the client side.

<br />

**See also:**

- [ContactsContract.SearchSnippets](https://developer.android.com/reference/android/provider/ContactsContract.SearchSnippets)
- [DEFERRED_SNIPPETING](https://developer.android.com/reference/android/provider/ContactsContract#DEFERRED_SNIPPETING)

Constant Value:

"deferred_snippeting_query"


### DIRECTORY_PARAM_KEY

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String DIRECTORY_PARAM_KEY
```

Query parameter that should be used by the client to access a specific
[Directory](https://developer.android.com/reference/android/provider/ContactsContract.Directory). The parameter value should be the _ID of the corresponding
directory, e.g.
`content://com.android.contacts/data/emails/filter/acme?directory=3`

<br />

Constant Value:

"directory"


### LIMIT_PARAM_KEY

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String LIMIT_PARAM_KEY
```

A query parameter that limits the number of results returned for supported URIs. The
parameter value should be an integer.

This parameter is not supported by all URIs. Supported URIs include, but not limited to,
[Contacts.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.Contacts#CONTENT_URI),
[RawContacts.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.RawContacts#CONTENT_URI),
[Data.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.Data#CONTENT_URI),
[ContactsContract.CommonDataKinds.Phone.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Phone#CONTENT_URI),
[ContactsContract.CommonDataKinds.Callable.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Callable#CONTENT_URI),
[ContactsContract.CommonDataKinds.Email.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Email#CONTENT_URI),
[ContactsContract.CommonDataKinds.Contactables.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Contactables#CONTENT_URI),

In order to limit the number of rows returned by a non-supported URI, you can implement a
[CursorWrapper](https://developer.android.com/reference/android/database/CursorWrapper) and override the [CursorWrapper.getCount()](https://developer.android.com/reference/android/database/CursorWrapper#getCount()) methods.

<br />

Constant Value:

"limit"


### PRIMARY_ACCOUNT_NAME

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String PRIMARY_ACCOUNT_NAME
```

A query parameter specifing a primary account. This parameter should be used with
[PRIMARY_ACCOUNT_TYPE](https://developer.android.com/reference/android/provider/ContactsContract#PRIMARY_ACCOUNT_TYPE). The contacts provider handling a query may rely on
this information to optimize its query results.

For example, in an email composition screen, its implementation can specify an account when
obtaining possible recipients, letting the provider know which account is selected during
the composition. The provider may use the "primary account" information to optimize
the search result.

<br />

Constant Value:

"name_for_primary_account"


### PRIMARY_ACCOUNT_TYPE

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String PRIMARY_ACCOUNT_TYPE
```

A query parameter specifing a primary account. This parameter should be used with
[PRIMARY_ACCOUNT_NAME](https://developer.android.com/reference/android/provider/ContactsContract#PRIMARY_ACCOUNT_NAME). See the doc in [PRIMARY_ACCOUNT_NAME](https://developer.android.com/reference/android/provider/ContactsContract#PRIMARY_ACCOUNT_NAME).

<br />

Constant Value:

"type_for_primary_account"


### REMOVE_DUPLICATE_ENTRIES

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String REMOVE_DUPLICATE_ENTRIES
```

A boolean parameter for [Phone.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Phone#CONTENT_URI),
[Email.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.Email#CONTENT_URI), and
[StructuredPostal.CONTENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.StructuredPostal#CONTENT_URI).
This enables a content provider to remove duplicate entries in results.

<br />

Constant Value:

"remove_duplicate_entries"


### STREQUENT_PHONE_ONLY

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String STREQUENT_PHONE_ONLY
```

A boolean parameter for [Contacts.CONTENT_STREQUENT_URI](https://developer.android.com/reference/android/provider/ContactsContract.Contacts#CONTENT_STREQUENT_URI) and
[Contacts.CONTENT_STREQUENT_FILTER_URI](https://developer.android.com/reference/android/provider/ContactsContract.Contacts#CONTENT_STREQUENT_FILTER_URI), which requires the ContactsProvider to
return only phone-related results.

<br />

Constant Value:

"strequent_phone_only"


## Fields

### AUTHORITY_URI

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final Uri AUTHORITY_URI
```

A content:// style uri to the authority for the contacts provider

<br />

## Public constructors

### ContactsContract

```
public ContactsContract ()
```

<br />

<br />

## Public methods

### isProfileId

Added in [API level 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static boolean isProfileId (long id)
```

This method can be used to identify whether the given ID is associated with profile
data. It does not necessarily indicate that the ID is tied to valid data, merely
that accessing data using this ID will result in profile access checks and will only
return data from the profile.

<br />

|              Parameters               ||
|------|---------------------------------|
| `id` | `long`: The ID to check. <br /> |

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | Whether the ID is associated with profile data. <br /> |