0

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.

Community
  • 1
  • 1
Manoj Fegde
  • 4,786
  • 15
  • 50
  • 95
  • Please don't down vote if somebody is unable to answer. – VVB Oct 29 '15 at 05:37
  • Dont down vote the question if you are not having knowledge about the question or having great knowledge about it. Do not show your kindness here. – Manoj Fegde Oct 29 '15 at 06:20
  • read documentation of `ContactsContract.CommonDataKinds` – pskink Oct 29 '15 at 10:37
  • Since my answer may be deleted by the forum police, here it is in the comment: Try the Android developer tutorial. It does most of what you require with good explanations. https://developer.android.com/training/contacts-provider/index.html – SoftWyer Nov 20 '15 at 19:32

0 Answers0