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.
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 CONTACT_ID
column
of the newly inserted raw contact.TIMES_CONTACTED
, LAST_TIME_CONTACTED
, STARRED
,
CUSTOM_RINGTONE
, SEND_TO_VOICEMAIL
. Changing any of
these columns on the Contact also changes them on all constituent raw
contacts.CONTENT_LOOKUP_URI
instead of CONTENT_URI
.PhoneLookup.CONTENT_FILTER_URI
,
which is optimized for this purpose.CONTENT_FILTER_URI
URI.
ContactsContract.Data
table.
The result will contain contact ID, name etc.
Contacts | |||
---|---|---|---|
long | _ID |
read-only | Row ID. Consider using LOOKUP_KEY instead. |
String | 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 | PHOTO_ID |
read-only | Reference to the row in the ContactsContract.Data table holding the photo.
That row has the mime type
CONTENT_ITEM_TYPE . The value of this field
is computed automatically based on the
IS_SUPER_PRIMARY field of the data rows of
that mime type. |
int | 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 | 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 | TIMES_CONTACTED |
read/write | The number of times the contact has been contacted. See
markAsContacted(ContentResolver, long) . When raw contacts are aggregated, this field is
computed automatically as the maximum number of times contacted among all
constituent raw contacts. Setting this field automatically changes the
corresponding field on all constituent raw contacts. |
long | LAST_TIME_CONTACTED |
read/write | The timestamp of the last time the contact was contacted. See
markAsContacted(ContentResolver, long) . Setting this field also automatically
increments TIMES_CONTACTED . When raw contacts are aggregated,
this field is computed automatically as the latest time contacted of all
constituent raw contacts. Setting this field automatically changes the
corresponding field on all constituent raw contacts. |
int | 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 | CUSTOM_RINGTONE |
read/write | A custom ringtone associated with a contact. Typically this is the
URI returned by an activity launched with the
ACTION_RINGTONE_PICKER intent. |
int | 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 | CONTACT_PRESENCE |
read-only | Contact IM presence status. See ContactsContract.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 basic. |
String | CONTACT_STATUS |
read-only | Contact's latest status update. Automatically computed as the latest of all constituent raw contacts' status updates. |
long | CONTACT_STATUS_TIMESTAMP |
read-only | The absolute time in milliseconds when the latest status was inserted/updated. |
String | CONTACT_STATUS_RES_PACKAGE |
read-only | The package containing resources for this status: label and icon. |
long | 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
CONTACT_STATUS_RES_PACKAGE . |
long | CONTACT_STATUS_ICON |
read-only | The resource ID of the icon for the source of contact status. This
resource is scoped by the CONTACT_STATUS_RES_PACKAGE . |
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ContactsContract.Contacts.AggregationSuggestions | A read-only sub-directory of a single contact aggregate that contains all aggregation suggestions (other contacts). |
||||||||||
ContactsContract.Contacts.Data | A sub-directory of a single contact that contains all of the constituent raw contact
ContactsContract.Data rows. |
||||||||||
ContactsContract.Contacts.Photo | A read-only sub-directory of a single contact that contains the contact's primary photo. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Uri | CONTENT_FILTER_URI | The content:// style URI used for "type-to-filter" functionality on the
CONTENT_URI URI. |
|||||||||
Uri | CONTENT_GROUP_URI | ||||||||||
String | CONTENT_ITEM_TYPE | The MIME type of a CONTENT_URI subdirectory of a single
person. |
|||||||||
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. | |||||||||
Uri | CONTENT_STREQUENT_FILTER_URI | The content:// style URI used for "type-to-filter" functionality on the
CONTENT_STREQUENT_URI URI. |
|||||||||
Uri | CONTENT_STREQUENT_URI | The content:// style URI for this table joined with useful data from
ContactsContract.Data , filtered to include only starred contacts
and the most frequently contacted contacts. |
|||||||||
String | CONTENT_TYPE | The MIME type of CONTENT_URI providing a directory of
people. |
|||||||||
Uri | CONTENT_URI | The content:// style URI for this table | |||||||||
String | CONTENT_VCARD_TYPE | The MIME type of a CONTENT_URI subdirectory of a single
person. |
|||||||||
Uri | CONTENT_VCARD_URI | Base Uri for referencing a single Contacts entry,
created by appending LOOKUP_KEY using
withAppendedPath(Uri, String) . |
|||||||||
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
|
|||||||||
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. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Computes a content URI (see
CONTENT_URI ) given a lookup URI. | |||||||||||
Mark a contact as having been contacted.
| |||||||||||
Opens an InputStream for the contacts's default photo and returns the
photo as a byte stream.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
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.
The MIME type of a CONTENT_URI
subdirectory of a single
person.
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 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.
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.
The content:// style URI for this table joined with useful data from
ContactsContract.Data
, filtered to include only starred contacts
and the most frequently contacted contacts.
The MIME type of CONTENT_URI
providing a directory of
people.
The MIME type of a CONTENT_URI
subdirectory of a single
person.
Base Uri
for referencing a single Contacts
entry,
created by appending LOOKUP_KEY
using
withAppendedPath(Uri, String)
. Provides
OpenableColumns
columns when queried, or returns the
referenced contact formatted as a vCard when opened through
openAssetFileDescriptor(Uri, String)
.
An alternative representation of the display name, such as "family name first"
instead of "given name first" for Western names. If an alternative is not
available, the values should be the same as DISPLAY_NAME_PRIMARY
.
A contacts provider is free to provide alternatives as necessary for its target market. For example the default Android Open Source Project contacts provider currently provides an alternative in a single case: if the display name is based on the structured name and the structured name follows the Western full name style, then the field contains the "family name first" version of the full name. Other cases may be added later.
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).
The information actually used to compute the name is stored in
DISPLAY_NAME_SOURCE
.
A contacts provider is free to choose whatever representation makes most sense for its target market. For example in the default Android Open Source Project implementation, if the display name is based on the structured name and the structured name follows the Western full-name style, then this field contains the "given name first" version of the full name.
The kind of data that is used as the display name for the contact, such as structured name or email address. See DisplayNameSources. TODO: convert DisplayNameSources to a link after it is un-hidden
Pronunciation of the full name in the phonetic alphabet specified by
PHONETIC_NAME_STYLE
.
The value may be set manually by the user. This capability is is of interest only in countries with commonly used phonetic alphabets, such as Japan and Korea. See PhoneticNameStyle.
TODO: convert PhoneticNameStyle to a link after it is un-hiddenThe phonetic alphabet used to represent the PHONETIC_NAME
. See
PhoneticNameStyle.
TODO: convert PhoneticNameStyle to a link after it is un-hidden
Sort key based on the alternative representation of the full name,
DISPLAY_NAME_ALTERNATIVE
. Thus for Western names,
it is the one using the "family name first" format.
Sort key that takes into account locale-based traditions for sorting
names in address books. The default
sort key is DISPLAY_NAME_PRIMARY
. For Chinese names
the sort key is the name's Pinyin spelling, and for Japanese names
it is the Hiragana version of the phonetic name.
Builds a CONTENT_LOOKUP_URI
style Uri
describing the
requested Contacts
entry.
contactUri | A CONTENT_URI row, or an existing
CONTENT_LOOKUP_URI to attempt refreshing.
|
---|
Build a CONTENT_LOOKUP_URI
lookup Uri
using the
given _ID
and LOOKUP_KEY
.
Computes a content URI (see CONTENT_URI
) given a lookup URI.
Returns null if the contact cannot be found.
Mark a contact as having been contacted. This updates the
TIMES_CONTACTED
and LAST_TIME_CONTACTED
for the
contact, plus the corresponding values of any associated raw
contacts.
resolver | the ContentResolver to use |
---|---|
contactId | the person who was contacted |
Opens an InputStream for the contacts's default photo and returns the photo as a byte stream. If there is not photo null will be returned.
contactUri | the contact whose photo should be used |
---|