# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Nested Classes | Constants | Inherited Constants | Fields | Methods | Inherited Methods

# ContactsContract.Contacts

`public static class ContactsContract.Contacts`
`extends Object` `implements BaseColumns, ContactsContract.ContactsColumns, ContactsContract.ContactOptionsColumns, ContactsContract.ContactNameColumns, ContactsContract.ContactStatusColumns`

java.lang.Object
↳ | android.provider.ContactsContract.Contacts

Constants for the contacts table, which contains a record per aggregate of raw contacts representing the same person.

### Operations

Insert
  A Contact cannot be created explicitly. When a raw contact is inserted, the provider will first try to find a Contact representing the same person. If one is found, the raw contact's `RawContacts#CONTACT_ID` column gets the _ID of the aggregate Contact. If no match is found, the provider automatically inserts a new Contact and puts its _ID into the `RawContacts#CONTACT_ID` column of the newly inserted raw contact.
Update
  Only certain columns of Contact are modifiable: `ContactsContract.ContactOptionsColumns.STARRED`, `ContactsContract.ContactOptionsColumns.CUSTOM_RINGTONE`, `ContactsContract.ContactOptionsColumns.SEND_TO_VOICEMAIL`. Changing any of these columns on the Contact also changes them on all constituent raw contacts.
Delete
  Be careful with deleting Contacts! Deleting an aggregate contact deletes all constituent raw contacts. The corresponding sync adapters will notice the deletions of their respective raw contacts and remove them from their back end storage.
Query
  - If you need to read an individual contact, consider using `CONTENT_LOOKUP_URI` instead of `CONTENT_URI`.
  - If you need to look up a contact by the phone number, use `PhoneLookup#CONTENT_FILTER_URI`, which is optimized for this purpose.
  - If you need to look up a contact by partial name, e.g. to produce filter-as-you-type suggestions, use the `CONTENT_FILTER_URI` URI.
  - If you need to look up a contact by some data element like email address, nickname, etc, use a query against the `ContactsContract.Data` table. The result will contain contact ID, name etc.

## Columns

Contacts
long | `BaseColumns._ID` | read-only | Row ID. Consider using `ContactsContract.ContactsColumns.LOOKUP_KEY` instead.
String | `ContactsContract.ContactsColumns.LOOKUP_KEY` | read-only | An opaque value that contains hints on how to find the contact if its row id changed as a result of a sync or aggregation.
long | NAME_RAW_CONTACT_ID | read-only | The ID of the raw contact that contributes the display name to the aggregate contact. During aggregation one of the constituent raw contacts is chosen using a heuristic: a longer name or a name with more diacritic marks or more upper case characters is chosen.
String | DISPLAY_NAME_PRIMARY | read-only | The display name for the contact. It is the display name contributed by the raw contact referred to by the NAME_RAW_CONTACT_ID column.
long | `ContactsContract.ContactsColumns.PHOTO_ID` | read-only | Reference to the row in the `ContactsContract.Data` table holding the photo. That row has the mime type `ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE`. The value of this field is computed automatically based on the `ContactsContract.DataColumns.IS_SUPER_PRIMARY` field of the data rows of that mime type.
long | `ContactsContract.ContactsColumns.PHOTO_URI` | read-only | A URI that can be used to retrieve the contact's full-size photo. This column is the preferred method of retrieving the contact photo.
long | `ContactsContract.ContactsColumns.PHOTO_THUMBNAIL_URI` | read-only | A URI that can be used to retrieve the thumbnail of contact's photo. This column is the preferred method of retrieving the contact photo.
int | `ContactsContract.ContactsColumns.IN_VISIBLE_GROUP` | read-only | An indicator of whether this contact is supposed to be visible in the UI. "1" if the contact has at least one raw contact that belongs to a visible group; "0" otherwise.
int | `ContactsContract.ContactsColumns.HAS_PHONE_NUMBER` | read-only | An indicator of whether this contact has at least one phone number. "1" if there is at least one phone number, "0" otherwise.
int | `ContactsContract.ContactOptionsColumns.STARRED` | read/write | An indicator for favorite contacts: '1' if favorite, '0' otherwise. When raw contacts are aggregated, this field is automatically computed: if any constituent raw contacts are starred, then this field is set to '1'. Setting this field automatically changes the corresponding field on all constituent raw contacts.
String | `ContactsContract.ContactOptionsColumns.CUSTOM_RINGTONE` | read/write | A custom ringtone associated with a contact. Typically this is the URI returned by an activity launched with the `RingtoneManager.ACTION_RINGTONE_PICKER` intent.
int | `ContactsContract.ContactOptionsColumns.SEND_TO_VOICEMAIL` | read/write | An indicator of whether calls from this contact should be forwarded directly to voice mail ('1') or not ('0'). When raw contacts are aggregated, this field is automatically computed: if all constituent raw contacts have SEND_TO_VOICEMAIL=1, then this field is set to '1'. Setting this field automatically changes the corresponding field on all constituent raw contacts.
int | `ContactsContract.ContactStatusColumns.CONTACT_PRESENCE` | read-only | Contact IM presence status. See `StatusUpdates` for individual status definitions. Automatically computed as the highest presence of all constituent raw contacts. The provider may choose not to store this value in persistent storage. The expectation is that presence status will be updated on a regular basis.
String | `ContactsContract.ContactStatusColumns.CONTACT_STATUS` | read-only | Contact's latest status update. Automatically computed as the latest of all constituent raw contacts' status updates.
long | `ContactsContract.ContactStatusColumns.CONTACT_STATUS_TIMESTAMP` | read-only | The absolute time in milliseconds when the latest status was inserted/updated.
String | `ContactsContract.ContactStatusColumns.CONTACT_STATUS_RES_PACKAGE` | read-only | The package containing resources for this status: label and icon.
long | `ContactsContract.ContactStatusColumns.CONTACT_STATUS_LABEL` | read-only | The resource ID of the label describing the source of contact status, e.g. "Google Talk". This resource is scoped by the `ContactsContract.ContactStatusColumns.CONTACT_STATUS_RES_PACKAGE`.
long | `ContactsContract.ContactStatusColumns.CONTACT_STATUS_ICON` | read-only | The resource ID of the icon for the source of contact status. This resource is scoped by the `ContactsContract.ContactStatusColumns.CONTACT_STATUS_RES_PACKAGE`.

## Summary

### Nested classes
`class` | `ContactsContract.Contacts.AggregationSuggestions` A read-only sub-directory of a single contact aggregate that contains all aggregation suggestions (other contacts).
`class` | `ContactsContract.Contacts.Data` A sub-directory of a single contact that contains all of the constituent raw contact `ContactsContract.Data` rows.
`class` | `ContactsContract.Contacts.Entity` A sub-directory of a contact that contains all of its `ContactsContract.RawContacts` as well as `ContactsContract.Data` rows.
`class` | `ContactsContract.Contacts.Photo` A read-only sub-directory of a single contact that contains the contact's primary photo.

### Constants
`String` | `CONTENT_ITEM_TYPE` The MIME type of a `CONTENT_URI` subdirectory of a single person.
`String` | `CONTENT_TYPE` The MIME type of `CONTENT_URI` providing a directory of people.
`String` | `CONTENT_VCARD_TYPE` The MIME type of a `CONTENT_URI` subdirectory of a single person.
`String` | `EXTRA_ADDRESS_BOOK_INDEX` Add this query parameter to a URI to get back row counts grouped by the address book index as cursor extras.
`String` | `EXTRA_ADDRESS_BOOK_INDEX_COUNTS` The array of group counts for the corresponding group.
`String` | `EXTRA_ADDRESS_BOOK_INDEX_TITLES` The array of address book index titles, which are returned in the same order as the data in the cursor.
`String` | `QUERY_PARAMETER_VCARD_NO_PHOTO` Boolean parameter that may be used with `CONTENT_VCARD_URI` and `CONTENT_MULTI_VCARD_URI` to indicate that the returned vcard should not contain a photo.

### Inherited constants
From interface `android.provider.BaseColumns`
`String` | `_COUNT` The count of rows in a directory.
`String` | `_ID` The unique ID for a row.
From interface `android.provider.ContactsContract.ContactsColumns`
`String` | `CONTACT_LAST_UPDATED_TIMESTAMP` Timestamp (milliseconds since epoch) of when this contact was last updated.
`String` | `DISPLAY_NAME` The display name for the contact.
`String` | `HAS_PHONE_NUMBER` An indicator of whether this contact has at least one phone number.
`String` | `IN_DEFAULT_DIRECTORY` Flag that reflects whether the contact exists inside the default directory.
`String` | `IN_VISIBLE_GROUP` Flag that reflects the `Groups#GROUP_VISIBLE` state of any `CommonDataKinds.GroupMembership` for this contact.
`String` | `IS_USER_PROFILE` Flag that reflects whether this contact represents the user's personal profile entry.
`String` | `LOOKUP_KEY` An opaque value that contains hints on how to find the contact if its row id changed as a result of a sync or aggregation.
`String` | `NAME_RAW_CONTACT_ID` Reference to the row in the RawContacts table holding the contact name.
`String` | `PHOTO_FILE_ID` Photo file ID of the full-size photo.
`String` | `PHOTO_ID` Reference to the row in the data table holding the photo.
`String` | `PHOTO_THUMBNAIL_URI` A URI that can be used to retrieve a thumbnail of the contact's photo.
`String` | `PHOTO_URI` A URI that can be used to retrieve the contact's full-size photo.
From interface `android.provider.ContactsContract.ContactOptionsColumns`
`String` | `CUSTOM_RINGTONE` URI for a custom ringtone associated with the contact.
`String` | `LAST_TIME_CONTACTED` This constant is deprecated. Contacts affinity information is no longer supported as of Android version `Build.VERSION_CODES.Q`. This column always contains 0.
`String` | `PINNED` The position at which the contact is pinned.
`String` | `SEND_TO_VOICEMAIL` Whether the contact should always be sent to voicemail.
`String` | `STARRED` Is the contact starred? Type: INTEGER (boolean)
`String` | `TIMES_CONTACTED` This constant is deprecated. Contacts affinity information is no longer supported as of Android version `Build.VERSION_CODES.Q`. This column always contains 0.
From interface `android.provider.ContactsContract.ContactNameColumns`
`String` | `DISPLAY_NAME_ALTERNATIVE` An alternative representation of the display name, such as "family name first" instead of "given name first" for Western names.
`String` | `DISPLAY_NAME_PRIMARY` The standard text shown as the contact's display name, based on the best available information for the contact (for example, it might be the email address if the name is not available).
`String` | `DISPLAY_NAME_SOURCE` The kind of data that is used as the display name for the contact, such as structured name or email address.
`String` | `PHONETIC_NAME` Pronunciation of the full name in the phonetic alphabet specified by `PHONETIC_NAME_STYLE`.
`String` | `PHONETIC_NAME_STYLE` The phonetic alphabet used to represent the `PHONETIC_NAME`.
`String` | `SORT_KEY_ALTERNATIVE` Sort key based on the alternative representation of the full name, `DISPLAY_NAME_ALTERNATIVE`.
`String` | `SORT_KEY_PRIMARY` Sort key that takes into account locale-based traditions for sorting names in address books.
From interface `android.provider.ContactsContract.ContactStatusColumns`
`String` | `CONTACT_CHAT_CAPABILITY` Contact Chat Capabilities.
`String` | `CONTACT_PRESENCE` Contact presence status.
`String` | `CONTACT_STATUS` Contact's latest status update.
`String` | `CONTACT_STATUS_ICON` The resource ID of the icon for the source of contact status.
`String` | `CONTACT_STATUS_LABEL` The resource ID of the label describing the source of contact status, e.g. "Google Talk".
`String` | `CONTACT_STATUS_RES_PACKAGE` The package containing resources for this status: label and icon.
`String` | `CONTACT_STATUS_TIMESTAMP` The absolute time in milliseconds when the latest status was inserted/updated.

### Fields
`public static final Uri` | `CONTENT_FILTER_URI` The content:// style URI used for "type-to-filter" functionality on the `CONTENT_URI` URI.
`public static final Uri` | `CONTENT_FREQUENT_URI` This field is deprecated. Frequent contacts are no longer supported as of Android version `Build.VERSION_CODES.Q`. This URI always returns an empty cursor. Caution: If you publish your app to the Google Play Store, this field doesn't sort results based on contacts frequency. For more information, see the Contacts Provider page.
`public static final Uri` | `CONTENT_GROUP_URI`
`public static final Uri` | `CONTENT_LOOKUP_URI` A content:// style URI for this table that should be used to create shortcuts or otherwise create long-term links to contacts.
`public static final Uri` | `CONTENT_MULTI_VCARD_URI` Base `Uri` for referencing multiple `Contacts` entry, created by appending `ContactsContract.ContactsColumns.LOOKUP_KEY` using `Uri#withAppendedPath(Uri, String)`.
`public static final Uri` | `CONTENT_STREQUENT_FILTER_URI` The content:// style URI used for "type-to-filter" functionality on the `CONTENT_STREQUENT_URI` URI.
`public static final Uri` | `CONTENT_STREQUENT_URI` The content:// style URI for this table joined with useful data from `ContactsContract.Data`, filtered to include only starred contacts.
`public static final Uri` | `CONTENT_URI` The content:// style URI for this table
`public static final Uri` | `CONTENT_VCARD_URI` Base `Uri` for referencing a single `Contacts` entry, created by appending `ContactsContract.ContactsColumns.LOOKUP_KEY` using `Uri#withAppendedPath(Uri, String)`.
`public static final Uri` | `ENTERPRISE_CONTENT_FILTER_URI` It supports the similar semantics as `CONTENT_FILTER_URI` and returns the same columns.

### Public methods
`static Uri` | `getLookupUri(ContentResolver resolver, Uri contactUri)` Builds a `CONTENT_LOOKUP_URI` style `Uri` describing the requested `Contacts` entry.
`static Uri` | `getLookupUri(long contactId, String lookupKey)` Build a `CONTENT_LOOKUP_URI` lookup `Uri` using the given `ContactsContract.Contacts#_ID` and `ContactsContract.ContactsColumns.LOOKUP_KEY`.
`static boolean` | `isEnterpriseContactId(long contactId)` Return TRUE if a contact ID is from the contacts provider on the enterprise profile.
`static Uri` | `lookupContact(ContentResolver resolver, Uri lookupUri)` Computes a content URI (see `CONTENT_URI`) given a lookup URI.
`static void` | `markAsContacted(ContentResolver resolver, long contactId)` This method is deprecated. Contacts affinity information is no longer supported as of Android version `Build.VERSION_CODES.Q`. This method is no-op.
`static InputStream` | `openContactPhotoInputStream(ContentResolver cr, Uri contactUri)` Opens an InputStream for the contacts's thumbnail photo and returns the photo as a byte stream.
`static InputStream` | `openContactPhotoInputStream(ContentResolver cr, Uri contactUri, boolean preferHighres)` Opens an InputStream for the contacts's photo and returns the photo as a byte stream.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Constants

### CONTENT_ITEM_TYPE

    public static final String CONTENT_ITEM_TYPE

The MIME type of a `CONTENT_URI` subdirectory of a single person.

Constant Value: "vnd.android.cursor.item/contact"

### CONTENT_TYPE

    public static final String CONTENT_TYPE

The MIME type of `CONTENT_URI` providing a directory of people.

Constant Value: "vnd.android.cursor.dir/contact"

### CONTENT_VCARD_TYPE

    public static final String CONTENT_VCARD_TYPE

The MIME type of a `CONTENT_URI` subdirectory of a single person.

Constant Value: "text/x-vcard"

### EXTRA_ADDRESS_BOOK_INDEX

    public static final String EXTRA_ADDRESS_BOOK_INDEX

Add this query parameter to a URI to get back row counts grouped by the address book index as cursor extras. For most languages it is the first letter of the sort key. This parameter does not affect the main content of the cursor.

     Example:

     import android.provider.ContactsContract.Contacts;

     Uri uri = Contacts.CONTENT_URI.buildUpon()
              .appendQueryParameter(Contacts.EXTRA_ADDRESS_BOOK_INDEX, "true")
              .build();
     Cursor cursor = getContentResolver().query(uri,
              new String[] {Contacts.DISPLAY_NAME},
              null, null, null);
     Bundle bundle = cursor.getExtras();
     if (bundle.containsKey(Contacts.EXTRA_ADDRESS_BOOK_INDEX_TITLES) &&
             bundle.containsKey(Contacts.EXTRA_ADDRESS_BOOK_INDEX_COUNTS)) {
         String sections[] =
                 bundle.getStringArray(Contacts.EXTRA_ADDRESS_BOOK_INDEX_TITLES);
         int counts[] = bundle.getIntArray(Contacts.EXTRA_ADDRESS_BOOK_INDEX_COUNTS);
     }

Constant Value: "android.provider.extra.ADDRESS_BOOK_INDEX"

### EXTRA_ADDRESS_BOOK_INDEX_COUNTS

    public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS

The array of group counts for the corresponding group. Contains the same number of elements as the EXTRA_ADDRESS_BOOK_INDEX_TITLES array.

TYPE: int[]

Constant Value: "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS"

### EXTRA_ADDRESS_BOOK_INDEX_TITLES

    public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES

The array of address book index titles, which are returned in the same order as the data in the cursor.

TYPE: String[]

Constant Value: "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES"

### QUERY_PARAMETER_VCARD_NO_PHOTO

    public static final String QUERY_PARAMETER_VCARD_NO_PHOTO

Boolean parameter that may be used with `CONTENT_VCARD_URI` and `CONTENT_MULTI_VCARD_URI` to indicate that the returned vcard should not contain a photo. This is useful for obtaining a space efficient vcard.

Constant Value: "no_photo"

## Fields

### CONTENT_FILTER_URI

    public static final Uri CONTENT_FILTER_URI

The content:// style URI used for "type-to-filter" functionality on the `CONTENT_URI` URI. The filter string will be used to match various parts of the contact name. The filter argument should be passed as an additional path segment after this URI.

### CONTENT_FREQUENT_URI

    public static final Uri CONTENT_FREQUENT_URI

This field is deprecated.
Frequent contacts are no longer supported as of Android version `Build.VERSION_CODES.Q`. This URI always returns an empty cursor.

Caution: If you publish your app to the Google Play Store, this field doesn't sort results based on contacts frequency. For more information, see the Contacts Provider page.

The content:// style URI for showing a list of frequently contacted people.

### CONTENT_GROUP_URI

    public static final Uri CONTENT_GROUP_URI

### CONTENT_LOOKUP_URI

    public static final Uri CONTENT_LOOKUP_URI

A content:// style URI for this table that should be used to create shortcuts or otherwise create long-term links to contacts. This URI should always be followed by a "/" and the contact's `ContactsContract.ContactsColumns.LOOKUP_KEY`. It can optionally also have a "/" and last known contact ID appended after that. This "complete" format is an important optimization and is highly recommended.

As long as the contact's row ID remains the same, this URI is equivalent to `CONTENT_URI`. If the contact's row ID changes as a result of a sync or aggregation, this URI will look up the contact using indirect information (sync IDs or constituent raw contacts).

Lookup key should be appended unencoded - it is stored in the encoded form, ready for use in a URI.

### CONTENT_MULTI_VCARD_URI

    public static final Uri CONTENT_MULTI_VCARD_URI

Base `Uri` for referencing multiple `Contacts` entry, created by appending `ContactsContract.ContactsColumns.LOOKUP_KEY` using `Uri#withAppendedPath(Uri, String)`. The lookup keys have to be joined with the colon (":") separator, and the resulting string encoded. Provides `OpenableColumns` columns when queried, or returns the referenced contact formatted as a vCard when opened through `ContentResolver#openAssetFileDescriptor(Uri, String)`.

Usage example:

The following code snippet creates a multi-vcard URI that references all the contacts in a user's database.

       public Uri getAllContactsVcardUri() {
           Cursor cursor = getActivity().getContentResolver().query(Contacts.CONTENT_URI,
               new String[] {Contacts.LOOKUP_KEY}, null, null, null);
           if (cursor == null) {
               return null;
           }
           try {
               StringBuilder uriListBuilder = new StringBuilder();
               int index = 0;
               while (cursor.moveToNext()) {
                   if (index != 0) uriListBuilder.append(':');
                   uriListBuilder.append(cursor.getString(0));
                   index++;
               }
               return Uri.withAppendedPath(Contacts.CONTENT_MULTI_VCARD_URI,
                       Uri.encode(uriListBuilder.toString()));
           } finally {
               cursor.close();
           }
       }

### CONTENT_STREQUENT_FILTER_URI

    public static final Uri CONTENT_STREQUENT_FILTER_URI

The content:// style URI used for "type-to-filter" functionality on the `CONTENT_STREQUENT_URI` URI. The filter string will be used to match various parts of the contact name. The filter argument should be passed as an additional path segment after this URI.

Caution: If you publish your app to the Google Play Store, this field doesn't sort results based on contacts frequency. For more information, see the Contacts Provider page.

### CONTENT_STREQUENT_URI

    public static final Uri CONTENT_STREQUENT_URI

The content:// style URI for this table joined with useful data from `ContactsContract.Data`, filtered to include only starred contacts. Frequent contacts are no longer included in the result as of Android version `Build.VERSION_CODES.Q`.

Caution: If you publish your app to the Google Play Store, this field doesn't sort results based on contacts frequency. For more information, see the Contacts Provider page.

### CONTENT_URI

    public static final Uri CONTENT_URI

The content:// style URI for this table

### CONTENT_VCARD_URI

    public static final Uri CONTENT_VCARD_URI

Base `Uri` for referencing a single `Contacts` entry, created by appending `ContactsContract.ContactsColumns.LOOKUP_KEY` using `Uri#withAppendedPath(Uri, String)`. Provides `OpenableColumns` columns when queried, or returns the referenced contact formatted as a vCard when opened through `ContentResolver#openAssetFileDescriptor(Uri, String)`.

### ENTERPRISE_CONTENT_FILTER_URI

    public static final Uri ENTERPRISE_CONTENT_FILTER_URI

It supports the similar semantics as `CONTENT_FILTER_URI` and returns the same columns. This URI requires `ContactsContract#DIRECTORY_PARAM_KEY` in parameters, otherwise it will throw IllegalArgumentException.

## Public methods

### getLookupUri

    public static Uri getLookupUri (ContentResolver resolver,
                    Uri contactUri)

Builds a `CONTENT_LOOKUP_URI` style `Uri` describing the requested `Contacts` entry.

Parameters
`resolver` | `ContentResolver`
`contactUri` | `Uri`: A `CONTENT_URI` row, or an existing `CONTENT_LOOKUP_URI` to attempt refreshing.

Returns
`Uri` |

### getLookupUri

    public static Uri getLookupUri (long contactId,
                    String lookupKey)

Build a `CONTENT_LOOKUP_URI` lookup `Uri` using the given `ContactsContract.Contacts#_ID` and `ContactsContract.ContactsColumns.LOOKUP_KEY`.

Returns null if unable to construct a valid lookup URI from the provided parameters.

Parameters
`contactId` | `long`
`lookupKey` | `String`

Returns
`Uri` |

### isEnterpriseContactId

    public static boolean isEnterpriseContactId (long contactId)

Return TRUE if a contact ID is from the contacts provider on the enterprise profile. `PhoneLookup#ENTERPRISE_CONTENT_FILTER_URI` may return such a contact.

Parameters
`contactId` | `long`

Returns
`boolean` |

### lookupContact

    public static Uri lookupContact (ContentResolver resolver,
                    Uri lookupUri)

Computes a content URI (see `CONTENT_URI`) given a lookup URI.

Returns null if the contact cannot be found.

Parameters
`resolver` | `ContentResolver`
`lookupUri` | `Uri`

Returns
`Uri` |

### markAsContacted

    public static void markAsContacted (ContentResolver resolver,
                    long contactId)

This method is deprecated.
Contacts affinity information is no longer supported as of Android version `Build.VERSION_CODES.Q`. This method is no-op.

Mark a contact as having been contacted. Updates two fields: `ContactsContract.ContactOptionsColumns.TIMES_CONTACTED` and `ContactsContract.ContactOptionsColumns.LAST_TIME_CONTACTED`. The TIMES_CONTACTED field is incremented by 1 and the LAST_TIME_CONTACTED field is populated with the current system time.

Caution: If you publish your app to the Google Play Store, this field is obsolete, regardless of Android version. For more information, see the Contacts Provider page.

Parameters
`resolver` | `ContentResolver`: the ContentResolver to use
`contactId` | `long`: the person who was contacted

### openContactPhotoInputStream

    public static InputStream openContactPhotoInputStream (ContentResolver cr,
                    Uri contactUri)

Opens an InputStream for the contacts's thumbnail photo and returns the photo as a byte stream.

Parameters
`cr` | `ContentResolver`: The content resolver to use for querying
`contactUri` | `Uri`: the contact whose photo should be used. This can be used with either a `CONTENT_URI` or a `CONTENT_LOOKUP_URI` URI.

Returns
`InputStream` | an InputStream of the photo, or null if no photo is present

See also:

- `if instead of the thumbnail the high-res picture is preferred`

### openContactPhotoInputStream

    public static InputStream openContactPhotoInputStream (ContentResolver cr,
                    Uri contactUri,
                    boolean preferHighres)

Opens an InputStream for the contacts's photo and returns the photo as a byte stream.

Parameters
`cr` | `ContentResolver`: The content resolver to use for querying
`contactUri` | `Uri`: the contact whose photo should be used. This can be used with either a `CONTENT_URI` or a `CONTENT_LOOKUP_URI` URI.
`preferHighres` | `boolean`: If this is true and the contact has a higher resolution photo available, it is returned. If false, this function always tries to get the thumbnail

Returns
`InputStream` | an InputStream of the photo, or null if no photo is present

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*