I'm reading ALL contacts from the phone like following:
Cursor cursor = MainApp.get().getContentResolver().query(
ContactsContract.Data.CONTENT_URI,
null,
null,
null,
ContactsContract.Data.CONTACT_ID + " ASC");
I read ContactsContract.Data.ACCOUNT_TYPE_AND_DATA_SET
and ContactsContract.RawContacts.ACCOUNT_NAME
from the contacts and analysed them because I want to distinguish between phone, sim and any other contact... But I only can see that the values are very phone specific.
1) I currently only know following values for ContactsContract.Data.ACCOUNT_TYPE_AND_DATA_SET
:
Phone contacts
com.sonyericsson.localcontacts (Sony Xperia S)
vnd.sec.contact.phone (Samsung Galaxy Alpha)
SIM contacts
com.sonyericsson.adncontacts (Sony Xperia S)
vnd.sec.contact.sim (Samsung Galaxy Alpha)
2) I currently only know following values for ContactsContract.Data.ACCOUNT_NAME
:
Phone contacts
Phone contacts
(Sony Xperia S)- EMPTY (Samsung Galaxy Alpha)
SIM contacts
SIM contacts
(Sony Xperia S)primary.sim.account_name
(Samsung Galaxy Alpha)
Google, WhatsApp, Viber contacts are easy to recognise, but how to find out it a contact is a phone contact or a sim contact on all phones (or at least on most)?
I don't want to display "vnd.sec.contact.sim" for sim contacts but want to display "SIM" instead.
Does anyone know other strings for my list? Or does anyone know a better solution?