Whatsapp stores its contacts in the ContactsContract.Data table. For each Whatsapp contact it stores two entries in the same table.
The common fields for both records for each contact are:
- account_type = "com.whatsapp"
- contact_id = 123 (Same _ID in ContactsContract.Contacts table)
- "vnd.android.cursor.item/vnd.com.whatsapp.profile" (if the record contains phone number).
- "vnd.android.cursor.item/name" (if the record contains contact name).
- contains either the name or the phone number depending on the ContactsContract.Data.MIMETYPE
this can be understood with the help of following diagram:
|How Whatsapp stores its contacts in Android Phonebook?|
Feel free to post your comments, queries and suggestions. Thanks