Build 1.0_r1(from source)

android.provider
Class Contacts.People

java.lang.Object
  extended by android.provider.Contacts.People
All Implemented Interfaces:
BaseColumns, Contacts.PeopleColumns, Contacts.PhonesColumns, Contacts.PresenceColumns, Im.CommonPresenceColumns, SyncConstValue
Enclosing class:
Contacts

public static final class Contacts.People
extends Object
implements BaseColumns, SyncConstValue, Contacts.PeopleColumns, Contacts.PhonesColumns, Contacts.PresenceColumns

This table contains people.


Nested Class Summary
static class Contacts.People.ContactMethods
          A subdirectory of a single person that contains all of their ContactMethods.
static class Contacts.People.Extensions
          The extensions for a person
static class Contacts.People.Phones
          A sub directory of a single person that contains all of their Phones.
 
Field Summary
static Uri CONTENT_FILTER_URI
          The content:// style URL for filtering people by name.
static String CONTENT_ITEM_TYPE
          The MIME type of a CONTENT_URI subdirectory of a single person.
static String CONTENT_TYPE
          The MIME type of CONTENT_URI providing a directory of people.
static Uri CONTENT_URI
          The content:// style URL for this table
static String DEFAULT_SORT_ORDER
          The default sort order for this table
static Uri DELETED_CONTENT_URI
          The content:// style URL for the table that holds the deleted contacts.
static String PRIMARY_EMAIL_ID
          The ID of the persons preferred email.
static String PRIMARY_ORGANIZATION_ID
          The ID of the persons preferred organization.
static String PRIMARY_PHONE_ID
          The ID of the persons preferred phone number.
 
Fields inherited from interface android.provider.BaseColumns
_COUNT, _ID
 
Fields inherited from interface android.provider.SyncConstValue
_SYNC_ACCOUNT, _SYNC_DIRTY, _SYNC_ID, _SYNC_LOCAL_ID, _SYNC_MARK, _SYNC_TIME, _SYNC_VERSION, NON_SYNCABLE_ACCOUNT
 
Fields inherited from interface android.provider.Contacts.PeopleColumns
CUSTOM_RINGTONE, DISPLAY_NAME, LAST_TIME_CONTACTED, NAME, NOTES, PHOTO_VERSION, SEND_TO_VOICEMAIL, STARRED, TIMES_CONTACTED
 
Fields inherited from interface android.provider.Contacts.PhonesColumns
ISPRIMARY, LABEL, NUMBER, NUMBER_KEY, TYPE, TYPE_CUSTOM, TYPE_FAX_HOME, TYPE_FAX_WORK, TYPE_HOME, TYPE_MOBILE, TYPE_OTHER, TYPE_PAGER, TYPE_WORK
 
Fields inherited from interface android.provider.Contacts.PresenceColumns
IM_ACCOUNT, IM_HANDLE, IM_PROTOCOL
 
Fields inherited from interface android.provider.Im.CommonPresenceColumns
AVAILABLE, AWAY, DO_NOT_DISTURB, IDLE, INVISIBLE, OFFLINE, PRESENCE_CUSTOM_STATUS, PRESENCE_STATUS, PRIORITY
 
Method Summary
static Uri addToGroup(ContentResolver resolver, long personId, long groupId)
          Adds a person to a group.
static Uri addToGroup(ContentResolver resolver, long personId, String groupName)
          Adds a person to a group referred to by name.
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_URI

public static final Uri CONTENT_URI
The content:// style URL for this table


CONTENT_FILTER_URI

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.


DELETED_CONTENT_URI

public static final Uri DELETED_CONTENT_URI
The content:// style URL for the table that holds the deleted contacts.


CONTENT_TYPE

public static final String CONTENT_TYPE
The MIME type of CONTENT_URI providing a directory of people.

See Also:
Constant Field Values

CONTENT_ITEM_TYPE

public static final String CONTENT_ITEM_TYPE
The MIME type of a CONTENT_URI subdirectory of a single person.

See Also:
Constant Field Values

DEFAULT_SORT_ORDER

public static final String DEFAULT_SORT_ORDER
The default sort order for this table

See Also:
Constant Field Values

PRIMARY_PHONE_ID

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)

See Also:
Constant Field Values

PRIMARY_EMAIL_ID

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)

See Also:
Constant Field Values

PRIMARY_ORGANIZATION_ID

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)

See Also:
Constant Field Values
Method Detail

markAsContacted

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

addToMyContactsGroup

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

addToGroup

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

addToGroup

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

createPersonInMyContactsGroup

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

queryGroups

public static Cursor queryGroups(ContentResolver resolver,
                                 long person)

setPhotoData

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

openContactPhotoInputStream

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

loadContactPhoto

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

Build 1.0_r1(from source)

Please submit a feedback, bug or feature