Попробуйте это (для SDK 2.0+).Пусть число будет в любом формате ... просто передайте его в виде строки ...
Добавьте разрешение android.permission.READ_CONTACTS
в манифесте.
/**
* Retrieves display name for the provided contact number
*
* @param context
* Context
* @param number
* The contact number for which display name is to be retrieved
* form android contacts
* @return Returns displayName for the contact if available. If display name
* is not available then it returns the same number
*/
public static String getContactNameFromNumber(Context context, String number) {
// If name is not found, number will be returned
String contactDisplayName = number;
Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI,
Uri.encode(number));
Cursor cursor = context.getContentResolver().query(uri,
new String[] { PhoneLookup.DISPLAY_NAME }, null, null, null);
if (cursor.moveToFirst()) {
contactDisplayName = cursor.getString(cursor
.getColumnIndex(PhoneLookup.DISPLAY_NAME));
}
cursor.close();
Log.d("GetNumber", "Retrived DisplayName for contact number:" + number
+ " DisplayName:" + contactDisplayName);
return contactDisplayName;
}