How to read contacts on Android 2.0

First, ensure that you have added <uses-permission android:name=”android.permission.READ_CONTACTS”/> to your AndroidManifest.xml file, then you can loop through your phone contacts like this: Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,null, null, null, null); while (cursor.moveToNext()) { String contactId = cursor.getString(cursor.getColumnIndex( ContactsContract.Contacts._ID)); String hasPhone = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER)); if (Boolean.parseBoolean(hasPhone)) { // You know it has a number so now query it … Read more