5. ContactsContract.Data
• Important raw contact columns
• Generic column names
o Data1 , … , Data16
• Type-specific column names
o CommonDataKinds.Photo
o CommonDataKinds.Email
o etc.
10. Query contacts and data
• Lookup Key vs. Contact ID
Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI,
String.valueOf(mId));
ContactsContract.Contacts.getLookupUri(mId, mLookupKey);
• Query entities API 11
Uri.withAppendedPath(mContactUri,
ContactsContract.Contacts.Entity.CONTENT_DIRECTORY);
11. Batch modification
• Yield points
o to prevent blocking the system
• Modification back references
o to use result of a previous operation
• Optimistic concurrency control
o modification of database without having to lock
the underlying repository
12. Determination changes
• ContentObserver
o onChange(boolean selfChange)
o onChange(boolean selfChange, Uri uri) API 16
• Check db modifications by query
o What we have?
o What we want?
13. SELECT * FROM raw_contacts
WHERE
id||‘.’||contact_id||’.’
||version
NOT IN (?)
SELECT * FROM data
WHERE
id||‘.’||data_version
NOT IN (?)
? starred, etc.