I see that there is a URI for inserting/contributing a raw contact to
the new (4.0) personal profile

ContactsContract.Profile.CONTENT_RAW_CONTACTS_URI

I am able to use this URI to insert a raw contact (with a specific
account type and name) into the personal profile.

However I don't see a corresponding URI for the Data contract such as

ContactsContract.Data.PROFILE_CONTENT_URI

How do one go about addint a data element to a raw contact that
contributes to a profile?

For example I ran the following code

private void insertPhoneNumber(long rawContactId)
{
  ContentValues cv = new ContentValues();
  cv.put(Data.RAW_CONTACT_ID, rawContactId);
  cv.put(Data.IS_USER_PROFILE, "1");
  cv.put(Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);
  cv.put(Phone.NUMBER,"P123 123 " + rawContactId);
  cv.put(Phone.TYPE,Phone.TYPE_HOME);
  this.mContext.getContentResolver().insert(Data.CONTENT_URI, cv);
  if (puri == null) {
      log("Not able to insert phone number");
  }
  else {
      log("Not able to insert phone number");           
  }
}

This returns a NULL phone uri indicating that the operation failed.

I am not able to get a clear picture from the documentation. I see
that there are two databases: one for the regular contacts
(contacts.db) and one for the profile contacts (profile.db). I also
see that the raw contacts for profile and the regular contacts are
kept separately.

However I am not able to insert a data value for a personal profile
raw contact.

Appreciate if someone can clarify

Thanks
Satya

-- 
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