problems with the old and new Contact API
<p>here's a few things i couldn't figure out and could find anyone else 
posting them in the discussion: </p>

<p>1.
In the new API</p>

<p>ContactsContract.AggregationExceptions table does not really work for 
me:</p>

<p>when I try to insert a row into the table, it gives me this error:</p>

<blockquote>
  <p>07-13 14:20:09.399: ERROR/XXXXX(3074):
  java.lang.UnsupportedOperationException:
  URI:
  content://com.android.contacts/aggregation_exceptions,
  calling user: ............</p>
</blockquote>

<p>my code here: </p>

<pre><code>ContentValues values = new ContentValues();

values.put(AggregationExceptions.RAW_CONTACT_ID1, 

String.valueOf(oldRawContactId)); 

values.put(AggregationExceptions.RAW_CONTACT_ID2, 

String.valueOf(newRawContactId)); 

values.put(AggregationExceptions.TYPE, AggregationExceptions.TYPE_KEEP_TOGETHER); 

mContentResolver.insert(AggregationExceptions.CONTENT_URI, values); 
</code></pre>

<p>and I'm sure the two raw contact id exists. </p>

<p>2.in the old API:</p>

<p>when I create a group in Contact book, the name of the group is not shown(or not shown correctly)</p>

<p>here's the code: </p>

<pre><code>ContentValues values = new ContentValues(); 

values.put(Contacts.Groups.SHOULD_SYNC, 1); 

values.put(Contacts.Groups.SYSTEM_ID, mGroupID); 

values.put(Contacts.Groups.NAME, mGroupTitle); 

mContentResolver.insert(Contacts.Groups.CONTENT_URI, values); 
</code></pre>

<p>3.in the old API: </p>

<p>when I insert a custom IM contact method for a contact, the data is inserted and shown correctly, but user cannot edit the contact using the default contact app any more. If I remove the contact method, user can edit the contact again. </p>

<p>here's the code for inserting the contact method: </p>

<pre><code>ContentValues values = new ContentValues(); 

values.put(ContactMethods.PERSON_ID, newContactId); 

values.put(ContactMethods.KIND, Contacts.KIND_IM); 

values.put(ContactMethods.TYPE, ContactMethods.TYPE_CUSTOM); 

values.put(ContactMethods.AUX_DATA, ContactMethods.encodeCustomImProtocol(MYIM_PROTOCOL)); 

values.put(ContactMethods.DATA, buddyId); 

values.put(ContactMethods.ISPRIMARY, 0); 

values.put(ContactMethods.LABEL, IM_LABEL); 

mContentResolver.insert(ContactMethods.CONTENT_URI, values);
</code></pre>
