I am developing an application in which i am able to read the contacts. I refereed this Link.
My code to read contact and basic information is as follow:
Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null);
while (phones.moveToNext()) {
String name = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
String phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
String contactID = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.CONTACT_ID));
}
phones.close();
Now I want to get the following things from contact as :
1.Type of contact as it is of Device, sim, google, face book etc contact.
2.The number of email for particular contact.
3.Total account(Face book, whats app, skype etc) count for the contact.
4.Total Event(Birthday, anniversary etc) count.
5.The contact is favorite or not
6.The contact is in any device group(Family, Friends) and yes then which groups?
I searched on google but not able to do the desired task.
Please suggest me what should i do.