Skip to main content

Posts

Showing posts with the label android-contacts

Fetching a large number of contacts

I'm trying to fetch all the Phone numbers and Emails in Android.by using this code. enter code here String KEY_NAME = "Name"; String KEY_NO = "No"; String selection = ContactsContract.CommonDataKinds.Phone.IN_VISIBLE_GROUP + " = 1"; String sortOrder = ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " COLLATE LOCALIZED ASC"; String data=""; String name=""; ContactEntry contactObj; String id; List<String> temp = new ArrayList<String>(); final String[] projection = new String[]{ContactsContract.Contacts._ID , ContactsContract.Contacts.DISPLAY_NAME , ContactsContract.Contacts.HAS_PHONE_NUMBER}; final String[] email_projection = new String[] {ContactsContract.CommonDataKinds.Email.DATA , ContactsContract.CommonDataKinds.Email.TYPE}; final String[] phone_projection = new String[] {ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.

Fetching a large number of contacts

I'm trying to fetch all the Phone numbers and Emails in Android.by using this code. enter code here String KEY_NAME = "Name"; String KEY_NO = "No"; String selection = ContactsContract.CommonDataKinds.Phone.IN_VISIBLE_GROUP + " = 1"; String sortOrder = ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " COLLATE LOCALIZED ASC"; String data=""; String name=""; ContactEntry contactObj; String id; List<String> temp = new ArrayList<String>(); final String[] projection = new String[]{ContactsContract.Contacts._ID , ContactsContract.Contacts.DISPLAY_NAME , ContactsContract.Contacts.HAS_PHONE_NUMBER}; final String[] email_projection = new String[] {ContactsContract.CommonDataKinds.Email.DATA , ContactsContract.CommonDataKinds.Email.TYPE}; final String[] phone_projection = new String[] {ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.

Android Contacts: how to get contact list with first name, last name and a picture

Is there a way to get all device contacts (aggregated, not raw) with contact ID, fist/last name, and contact picture? Currently I am using the code below but it does not return structured name: private static final String CONTACTS_SORT_ORDER = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC"; // all contacts public final String[] columns = { ContactsContract.Contacts._ID, ContactsContract.Contacts.DISPLAY_NAME, ContactsContract.Contacts.PHOTO_THUMBNAIL_URI}; c = contentResolver.query(Contacts.CONTENT_URI, null, null, null, CONTACTS_SORT_ORDER); Thanks