Posts

Showing posts from August, 2015

Detecting Changes in Android Contacts

Introduction In this post, we'll explore how to detect changes in Android contacts. Android OS provides a mechanism for contact storage known as the Contacts Provider. This provider offers a structured set of data and a standard interface that connects data across different processes. Structure of Android Contacts ContactsRaw Table _id : RAW_CONTACT_ID account_name : e.g., email address account_type : e.g., com.google.com deleted : Indicates if the contact is deleted The ContactsContract.RawContacts.CONTENT_URI table contains original contacts, mainly storing RAW_CONTACT_ID . Contact details are stored in the ContactsContract.Data table. Contacts Table _id : CONTACT_ID (refers to a group of RAW_CONTACT_ID s) lookup : Provides a link to all contact details in this table The Contacts.CONTENT_URI table groups RawContacts based on merging rules. If a raw contact can't be grouped with an existing contact, a new contact is created. The LOOKUP_KEY is a permanent link to a conta