Android
android.provider
public static final class

android.provider.Contacts.People

java.lang.Object
android.provider.Contacts.People BaseColumns Contacts.PeopleColumns Contacts.PhonesColumns Contacts.PresenceColumns

This table contains people.

Nested Classes
Contacts.People.ContactMethods A subdirectory of a single person that contains all of their ContactMethods. 
Contacts.People.Extensions The extensions for a person  
Contacts.People.Phones A sub directory of a single person that contains all of their Phones. 

Summary

Constants

      Value  
Uri  CONTENT_FILTER_URI  The content:// style URL for filtering people by name.     
String  CONTENT_ITEM_TYPE  The MIME type of a CONTENT_URI subdirectory of a single person.  "vnd.android.cursor.item/person" 
String  CONTENT_TYPE  The MIME type of CONTENT_URI providing a directory of people.  "vnd.android.cursor.dir/person" 
Uri  CONTENT_URI  The content:// style URL for this table      
String  DEFAULT_SORT_ORDER  The default sort order for this table   "name ASC" 
Uri  DELETED_CONTENT_URI  The content:// style URL for the table that holds the deleted contacts.     
String  NON_SYNCABLE_ACCOUNT  Used to indicate that this account is not synced   "non_syncable" 
String  PRIMARY_EMAIL_ID  The ID of the persons preferred email.  "primary_email" 
String  PRIMARY_ORGANIZATION_ID  The ID of the persons preferred organization.  "primary_organization" 
String  PRIMARY_PHONE_ID  The ID of the persons preferred phone number.  "primary_phone" 
String  _SYNC_ACCOUNT  The account that was used to sync the entry to the device.  "_sync_account" 
String  _SYNC_DIRTY  Used to indicate that local, unsynced, changes are present.  "_sync_dirty" 
String  _SYNC_ID  The unique ID for a row assigned by the sync source.  "_sync_id" 
String  _SYNC_LOCAL_ID  Used in temporary provider while syncing, always NULL for rows in persistent providers.  "_sync_local_id" 
String  _SYNC_MARK  Used only in persistent providers, and only during merging.  "_sync_mark" 
String  _SYNC_TIME  The last time, from the sync source's point of view, that this row has been synchronized.  "_sync_time" 
String  _SYNC_VERSION  The version of the row, as assigned by the server.  "_sync_version" 
Constants inherited from interface android.provider.BaseColumns
Constants inherited from interface android.provider.Contacts.PeopleColumns
Constants inherited from interface android.provider.Contacts.PhonesColumns
Constants inherited from interface android.provider.Contacts.PresenceColumns

Public Methods

      static    Uri  addToGroup(ContentResolver resolver, long personId, String groupName)
Adds a person to a group referred to by name.
      static    Uri  addToGroup(ContentResolver resolver, long personId, long groupId)
Adds a person to a group.
      static    Uri  addToMyContactsGroup(ContentResolver resolver, long personId)
Adds a person to the My Contacts group.
      static    Uri  createPersonInMyContactsGroup(ContentResolver resolver, ContentValues values)
Creates a new contacts and adds it to the "My Contacts" group.
      static    Bitmap  loadContactPhoto(Context context, Uri person, int placeholderImageResource, BitmapFactory.Options options)
Opens an InputStream for the person's photo and returns the photo as a Bitmap.
      static    void  markAsContacted(ContentResolver resolver, long personId)
Mark a person as having been contacted.
      static    InputStream  openContactPhotoInputStream(ContentResolver cr, Uri person)
Opens an InputStream for the person's photo and returns the photo as a Bitmap.
      static    Cursor  queryGroups(ContentResolver resolver, long person)
      static    void  setPhotoData(ContentResolver cr, Uri person, byte[] data)
Set the photo for this person.
Methods inherited from class java.lang.Object

Details

Constants

public static final Uri CONTENT_FILTER_URI

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

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/person"

public static final String CONTENT_TYPE

The MIME type of CONTENT_URI providing a directory of people.
Constant Value: "vnd.android.cursor.dir/person"

public static final Uri CONTENT_URI

The content:// style URL for this table

public static final String DEFAULT_SORT_ORDER

The default sort order for this table
Constant Value: "name ASC"

public static final Uri DELETED_CONTENT_URI

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

public static final String NON_SYNCABLE_ACCOUNT

Used to indicate that this account is not synced
Constant Value: "non_syncable"

public static final String PRIMARY_EMAIL_ID

The ID of the persons preferred email.

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

Constant Value: "primary_email"

public static final String PRIMARY_ORGANIZATION_ID

The ID of the persons preferred organization.

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

Constant Value: "primary_organization"

public static final String PRIMARY_PHONE_ID

The ID of the persons preferred phone number.

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

Constant Value: "primary_phone"

public static final String _SYNC_ACCOUNT

The account that was used to sync the entry to the device.

Type: TEXT

Constant Value: "_sync_account"

public static final String _SYNC_DIRTY

Used to indicate that local, unsynced, changes are present.

Type: INTEGER (long)

Constant Value: "_sync_dirty"

public static final String _SYNC_ID

The unique ID for a row assigned by the sync source. NULL if the row has never been synced.

Type: TEXT

Constant Value: "_sync_id"

public static final String _SYNC_LOCAL_ID

Used in temporary provider while syncing, always NULL for rows in persistent providers.

Type: INTEGER (long)

Constant Value: "_sync_local_id"

public static final String _SYNC_MARK

Used only in persistent providers, and only during merging.

Type: INTEGER (long)

Constant Value: "_sync_mark"

public static final String _SYNC_TIME

The last time, from the sync source's point of view, that this row has been synchronized.

Type: INTEGER (long)

Constant Value: "_sync_time"

public static final String _SYNC_VERSION

The version of the row, as assigned by the server.

Type: TEXT

Constant Value: "_sync_version"

Public Methods

public static Uri addToGroup(ContentResolver resolver, long personId, String groupName)

Adds a person to a group referred to by name.

Parameters

resolver the resolver to use
personId the person to add to the group
groupName the name of the group to add the contact to

Returns

  • the URI of the group membership row

Throws

IllegalStateException if the group can't be found

public static Uri addToGroup(ContentResolver resolver, long personId, long groupId)

Adds a person to a group.

Parameters

resolver the resolver to use
personId the person to add to the group
groupId the group to add the person to

Returns

  • the URI of the group membership row

public static Uri addToMyContactsGroup(ContentResolver resolver, long personId)

Adds a person to the My Contacts group.

Parameters

resolver the resolver to use
personId the person to add to the group

Returns

  • the URI of the group membership row

Throws

IllegalStateException if the My Contacts group can't be found

public static Uri createPersonInMyContactsGroup(ContentResolver resolver, ContentValues values)

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

Parameters

resolver the ContentResolver to use
values the values to use when creating the contact

Returns

  • the URI of the contact, or null if the operation fails

public static Bitmap loadContactPhoto(Context context, Uri person, int placeholderImageResource, BitmapFactory.Options options)

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 the Context
person the person whose photo should be used
placeholderImageResource the image resource to use if the person doesn't have a photo
options the decoding options, can be set to null

public static void markAsContacted(ContentResolver resolver, long personId)

Mark a person as having been contacted.

Parameters

resolver the ContentResolver to use
personId the person who was contacted

public static InputStream openContactPhotoInputStream(ContentResolver cr, Uri person)

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 the person whose photo should be used

public static Cursor queryGroups(ContentResolver resolver, long person)

public static void setPhotoData(ContentResolver cr, Uri person, byte[] data)

Set the photo for this person. data may be null

Parameters

cr the ContentResolver to use
person the Uri of the person whose photo is to be updated
data the byte[] that represents the photo
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48