read contracts from android phone

//http://www.technotalkative.com/android-fetch-inbox-sms/

//Code
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));
Log.d(“TAG”, “PHONEnO” + phoneNumber);

}
phones.close();

//Android sdk just bellow the line of manifest

Leave a Reply

Your email address will not be published. Required fields are marked *