4) What sort of identifier should I represent a contact with in my
local data, so I can later get their most-current data?

Use lookup-style Uris, as they are designed to help with fuzzy
resolution when the contact changes, or is split/joined by the user.
Contacts.getLookupUri() and Data.getContactLookupUri() can help you
build these lookup Uris from columns when you already know them, or
from normal ContentUris.withAppendedId()-style Uris.


6) How do I add a contact to the address book from within an app?

One of the easiest ways is to use Intents.Insert, since it doesn't
require adding the WRITE_CONTACTS permission to your app:

http://d.android.com/reference/android/provider/ContactsContract.Intents.Insert.html


7) How do I add custom data to a contact?

Pick a well-scoped MIME-type and just start using it as Data.MIMETYPE
when inserting custom Data rows.  For example, a row describing a VoIP
profile might use something like
"vnd.android.cursor.item/vnd.com.example.voip.profile".


9) How do I /get/ the nifty status messages and the source for them
(a'la 'Away for lunch' on 'Google Talk,' or 'eating a pie!' on
'Facebook'), so I can display them alongside a contact in my own app?
(Alternatively, some ask how they can set the nifty status messages
and have them appear in the QuickContact bar or in other apps.)

Status messages like that can be read through StatusUpdates, and each
row is strongly tied to a Data row.  When status information is
displayed across the system, there is logic that picks the "best"
update based on timestamp.

http://d.android.com/reference/android/provider/ContactsContract.StatusUpdates.html

To add StatusUpdates you should attach them to a specific RawContact
owned by your application.  (This allows users to split and join the
RawContact from your service to the correct person in their address
book.)


10) How do I add an action to the QuickContact bar for a contact?

This is partially covered in this thread:

http://groups.google.com/group/android-developers/browse_thread/thread/fe814aa9149da1f0/

When Quick Contact encounters a custom Data row, it follows that row
back to the owning sync adapter (through ACCOUNT_NAME and _TYPE) to
look for XML metadata that describes how to render the row, both as a
list item when viewing the contact, and as a Quick Contact icon.  The
Quick Contact case also performs PackageManager queries to find apps
that support ACTION_VIEW on the custom MIME-type defined for that row,
which means you'll need to add an <intent-filter>.


13) How do I add a contact to a group?
14) How do I remove a contact from a group?

Similar to the original Contacts API, RawContacts can contain Data
rows that indicate GroupMembership.


-- 
Jeff Sharkey
jshar...@android.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to