My application user registers a phone number, name or an email ID with
my application. Now given one of these, I want to lookup the
ContactsContract provider and get the others.

Given
1. the email: I am querying
ContactsContract.CommonDataKinds.Email.CONTENT_LOOKUP_URI and getting
{ContactsContract.CommonDataKinds.Email.CONTACT_ID,
ContactsContract.Data.DISPLAY_NAME,
ContactsContract.CommonDataKinds.Phone.NUMBER}. This works.

2. given the number, I want to use the PhoneLookup.CONTENT_FILTER_URI.
I can get the name using DISPLAY_NAME, but I cant get the email, so
I'll have to use the CONTACT_ID. So in this table, does _ID correspond
to CONTACT_ID?

3. given the name, I have to use the DATA table, and I can get the
number. For the email I have to get the CONTACT_ID and read the email
from where?

Is my assumption that CONTACT_ID can get us name, number, email and
the contact's picture information correct? Do _IDs correspond to
CONTACT_ID (of course not at all places, but if a record is about a
user, can I assume that _ID = CONTACT_ID).

Is there any better way to do this? I do it only once for the whole
app's lifetime so I can compromise on efficiency for correctness: the
phone numbers and name inputs to my app can be malformatted, and I
want ContactsContract to help me out here.

Any suggestions?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to