Phone numbers are stored in their own table and need to be queried separately. To query the phone number table use the URI stored in the SDK variable Contacts.Phones.CONTENT_URI. Use a WHERE conditional to get the phone numbers for the specified contact.
if (Integer.parseInt(cur.getString(
cur.getColumnIndex(People.PRIMARY_PHONE_ID))) > 0) {
Cursor pCur = cr.query(
Contacts.Phones.CONTENT_URI,
null,
Contacts.Phones.PERSON_ID +" = ?",
new String[]{id}, null);
int i=0;
int pCount = pCur.getCount();
String[] phoneNum = new String[pCount];
String[] phoneType = new String[pCount];
while (pCur.moveToNext()) {
phoneNum[i] = pCur.getString(
pCur.getColumnIndex(Contacts.Phones.NUMBER));
phoneType[i] = pCur.getString(
pCur.getColumnIndex(Contacts.Phones.TYPE));
i++;
}
}
Query the phones table and get a Cursor stored in pCur. Since the Android contacts database can store multiple phone numbers per contact we need to loop through the returned results. In addition to returning the phone number the query also returned the type of number (home, work, mobile, etc).
Also read this tutorial about Working With Android Contacts API For 1.6 and Before