When an Android phone receives a call it automatically checks if the call exists in its own contact database. I was wondering if there is a simple way to access that information
Here is the code for 2.0 and later
Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
Cursor cursor = resolver.query(uri, new String[]{PhoneLookup.DISPLAY_NAME}, null, null, null);
if (cursor != null && cursor.moveToFirst()) {
String name = cursor.getString(0);
cursor.close();
}