I haven't been able to find a straight answer on this. Can anyone tell me if it's possible to get the contact info of the phone's owner in an Android App?
I have found a very easy way (got it from digging into the 4.1 Messaging app!)
projection for cursor is
final String[] SELF_PROJECTION = new String[] { Phone._ID,Phone.DISPLAY_NAME, };
Cursor is :
Cursor cursor = activity.getContentResolver().query(Profile.CONTENT_URI, SELF_PROJECTION, null, null, null);
now just do a simple
cursor.moveToFirst():
and then fetch the contact id via
cursor.getString(0)
and the contact name via
cursor.getString(1)
and..... you're done!