Added in API level 1
Deprecated in API level 5

People

class People : BaseColumns, Contacts.PeopleColumns, Contacts.PhonesColumns, Contacts.PresenceColumns
kotlin.Any
   ↳ android.provider.Contacts.People

This table contains people.

Summary

Nested classes

A subdirectory of a single person that contains all of their ContactMethods.

The extensions for a person

A sub directory of a single person that contains all of their Phones.

Constants
static String

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

static String

The MIME type of CONTENT_URI providing a directory of people.

static String

The default sort order for this table

static String

The ID of the persons preferred email.

static String

The ID of the persons preferred organization.

static String

The ID of the persons preferred phone number.

Inherited constants
Public methods
static Uri!
addToGroup(resolver: ContentResolver!, personId: Long, groupName: String!)

Adds a person to a group referred to by name.

static Uri!
addToGroup(resolver: ContentResolver!, personId: Long, groupId: Long)

Adds a person to a group.

static Uri!
addToMyContactsGroup(resolver: ContentResolver!, personId: Long)

Adds a person to the My Contacts group.

static Uri!

Creates a new contacts and adds it to the "My Contacts" group.

static Bitmap!
loadContactPhoto(context: Context!, person: Uri!, placeholderImageResource: Int, options: BitmapFactory.Options!)

Opens an InputStream for the person's photo and returns the photo as a Bitmap.

static Unit
markAsContacted(resolver: ContentResolver!, personId: Long)

This API is no longer supported as of O.

static InputStream!

Opens an InputStream for the person's photo and returns the photo as a Bitmap.

static Cursor!
queryGroups(resolver: ContentResolver!, person: Long)

static Unit
setPhotoData(cr: ContentResolver!, person: Uri!, data: ByteArray!)

Set the photo for this person.

Properties
static Uri!

The content:// style URL for filtering people by name.

static Uri!

The content:// style URL for this table

static Uri!

The content:// style URL for the table that holds the deleted contacts.

Constants

CONTENT_ITEM_TYPE

Added in API level 1
static val CONTENT_ITEM_TYPE: String

Deprecated: see android.provider.ContactsContract

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

Value: "vnd.android.cursor.item/person"

CONTENT_TYPE

Added in API level 1
static val CONTENT_TYPE: String

Deprecated: see android.provider.ContactsContract

The MIME type of CONTENT_URI providing a directory of people.

Value: "vnd.android.cursor.dir/person"

DEFAULT_SORT_ORDER

Added in API level 1
static val DEFAULT_SORT_ORDER: String

Deprecated: see android.provider.ContactsContract

The default sort order for this table

Value: "name ASC"

PRIMARY_EMAIL_ID

Added in API level 1
static val PRIMARY_EMAIL_ID: String

Deprecated: see android.provider.ContactsContract

The ID of the persons preferred email.

Type: INTEGER (foreign key to contact_methods table on the _ID field)

Value: "primary_email"

PRIMARY_ORGANIZATION_ID

Added in API level 1
static val PRIMARY_ORGANIZATION_ID: String

Deprecated: see android.provider.ContactsContract

The ID of the persons preferred organization.

Type: INTEGER (foreign key to organizations table on the _ID field)

Value: "primary_organization"

PRIMARY_PHONE_ID

Added in API level 1
static val PRIMARY_PHONE_ID: String

Deprecated: see android.provider.ContactsContract

The ID of the persons preferred phone number.

Type: INTEGER (foreign key to phones table on the _ID field)

Value: "primary_phone"

Public methods

addToGroup

Added in API level 1
static fun addToGroup(
    resolver: ContentResolver!,
    personId: Long,
    groupName: String!
): Uri!

Deprecated: see android.provider.ContactsContract

Adds a person to a group referred to by name.

Parameters
resolver ContentResolver!: the resolver to use
personId Long: the person to add to the group
groupName String!: the name of the group to add the contact to
Return
Uri! the URI of the group membership row
Exceptions
java.lang.IllegalStateException if the group can't be found

addToGroup

Added in API level 1
static fun addToGroup(
    resolver: ContentResolver!,
    personId: Long,
    groupId: Long
): Uri!

Deprecated: see android.provider.ContactsContract

Adds a person to a group.

Parameters
resolver ContentResolver!: the resolver to use
personId Long: the person to add to the group
groupId Long: the group to add the person to
Return
Uri! the URI of the group membership row

addToMyContactsGroup

Added in API level 1
static fun addToMyContactsGroup(
    resolver: ContentResolver!,
    personId: Long
): Uri!

Deprecated: see android.provider.ContactsContract

Adds a person to the My Contacts group.

Parameters
resolver ContentResolver!: the resolver to use
personId Long: the person to add to the group
Return
Uri! the URI of the group membership row
Exceptions
java.lang.IllegalStateException if the My Contacts group can't be found

createPersonInMyContactsGroup

Added in API level 1
static fun createPersonInMyContactsGroup(
    resolver: ContentResolver!,
    values: ContentValues!
): Uri!

Deprecated: see android.provider.ContactsContract

Creates a new contacts and adds it to the "My Contacts" group.

Parameters
resolver ContentResolver!: the ContentResolver to use
values ContentValues!: the values to use when creating the contact
Return
Uri! the URI of the contact, or null if the operation fails

loadContactPhoto

Added in API level 1
static fun loadContactPhoto(
    context: Context!,
    person: Uri!,
    placeholderImageResource: Int,
    options: BitmapFactory.Options!
): Bitmap!

Deprecated: see android.provider.ContactsContract

Opens an InputStream for the person's photo and returns the photo as a Bitmap. If the person's photo isn't present returns the placeholderImageResource instead.

Parameters
context Context!: the Context
person Uri!: the person whose photo should be used
placeholderImageResource Int: the image resource to use if the person doesn't have a photo
options BitmapFactory.Options!: the decoding options, can be set to null

markAsContacted

Added in API level 1
static fun markAsContacted(
    resolver: ContentResolver!,
    personId: Long
): Unit

Deprecated: Deprecated in Java.

This API is no longer supported as of O.

openContactPhotoInputStream

Added in API level 1
static fun openContactPhotoInputStream(
    cr: ContentResolver!,
    person: Uri!
): InputStream!

Deprecated: see android.provider.ContactsContract

Opens an InputStream for the person's photo and returns the photo as a Bitmap. If the person's photo isn't present returns the placeholderImageResource instead.

Parameters
person Uri!: the person whose photo should be used

queryGroups

Added in API level 1
static fun queryGroups(
    resolver: ContentResolver!,
    person: Long
): Cursor!

Deprecated: see android.provider.ContactsContract

setPhotoData

Added in API level 1
static fun setPhotoData(
    cr: ContentResolver!,
    person: Uri!,
    data: ByteArray!
): Unit

Deprecated: see android.provider.ContactsContract

Set the photo for this person. data may be null

Parameters
cr ContentResolver!: the ContentResolver to use
person Uri!: the Uri of the person whose photo is to be updated
data ByteArray!: the byte[] that represents the photo

Properties

CONTENT_FILTER_URI

Added in API level 1
static val CONTENT_FILTER_URI: Uri!

Deprecated: see android.provider.ContactsContract

The content:// style URL for filtering people by name. The filter argument should be passed as an additional path segment after this URI.

CONTENT_URI

Added in API level 1
static val CONTENT_URI: Uri!

Deprecated: see android.provider.ContactsContract

The content:// style URL for this table

DELETED_CONTENT_URI

Added in API level 1
static val DELETED_CONTENT_URI: Uri!

Deprecated: see android.provider.ContactsContract

The content:// style URL for the table that holds the deleted contacts.