I'm unable to find detailed information about the aggregation process in Android's contacts. I'm aware of the ContactsContract.Contacts
-> ContactsContract.RawContacts
-> ContactsContract.Data
structure (as described on http://developer.android.com/guide/topics/providers/contacts-provider.html), and that a Contact
consists of Raw Contacts
, which are grouped together through one Contact_ID
.
What I specifically want to know is: under what circumstances are Raw Contacts grouped into one Contact?
I found this question and answer - specifically the last option:
At least one of the two raw contacts is missing the name altogether and they are sharing a phone number, an email address or a nickname (for example,
Bob Parr [incredible@android.com] = incredible@android.com
).
I tried this out, however, it doesn't seem to work. I want to know if I can add a Raw Contact to the local contacts and set only the ACCOUNT_TYPE
, ACCOUNT_NAME
and phone or emailaddress, and if this will be automatically aggregrated with a raw contact for whom this phone number or emailaddress already exists. So for example:
(ContactsContract.Contacts.
)_ID
(Similar to ContactsContract.RawContacts.Contact_ID
): 1188300 consists of:
- Raw Contact ID 20905
MIMETYPE = \email_v2
ACCOUNT_TYPE = com.google
NAME = Example Test
EMAIL = test@gmail.com
- Raw Contact ID 20897
MIMETYPE = \phone_v2
ACCOUNT_TYPE = com.google
NAME = Example Test
EMAIL = 123456
After adding the following:
- Raw Contact
MIMETYPE = \email_v2
ACCOUNT_TYPE = com.exampleApp
EMAIL = test@gmail.com
will this result into:
(ContactsContract.Contacts.
)_ID
: 1188300 consisting of:
- Raw Contact ID 20905
MIMETYPE = \email_v2
ACCOUNT_TYPE = com.google
NAME = Example Test
EMAIL = test@gmail.com
Raw Contact ID 20897
MIMETYPE = \phone_v2
ACCOUNT_TYPE = com.google
NAME = Example Test
EMAIL = 123456
Raw Contact ID 20899 (or whatever number)
MIMETYPE = \email_v2
ACCOUNT_TYPE = com.exampleApp
NAME = Example Test
EMAIL = test@gmail.com