Note that the platform doesn't actually have a concept of "the owner", and
in fact the READ_OWNER_DATA and WRITE_OWNER_DATA do not protect anything or
are associated with any API.  Actually I just removed them from the next
release because they didn't do anything...

On Fri, Sep 3, 2010 at 11:01 AM, Dritan <[email protected]> wrote:

> Hello,
>
> I'm writing an app on my IO Magic to make use of the owner's data
> (first, middle, last, email(s), phone(s)) and one or more contacts the
> owner
> can choose. The application will find common patterns and whatnot.
>
> I have given my app READ_CONTACTS, WRITE_CONTACTS, READ_OWNER_DATA,
> WRITE_OWNER_DATA permissions in my AndroidManifest.xml
>
> Initially I used the People class which was deprecated, then I
> switched to ContactsContract.Contacts... to try pull explicitly the
> first (given), middle, and last (family)
> names, then phone numbers, emails, etc... but I cannot seem to be able
> to fetch these columns via:
>
> Cursor c1 =
> getContentResolver().query(ContactsContract.Data.CONTENT_URI, null,
> ContactsContract.CommonDataKinds.StructuredName.CONTACT_ID +" = ?",
> new String[]{id}, null);
>
> Or even this
>
> Cursor cc =
> getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,
> null, null,null, null);
> if (cc.moveToFirst()){
>                        String [] names = cc.getColumnNames();
>                        for (int j=0; j<names.length; j++){
>                                Log.d("Contacts", "COL NAME:
> "+names[j]);
>                                Log.d("Contacts", "========>COL VALUE:
> "+cc.getString(cc.getColumnIndexOrThrow(names[j]))+"\n\n");
>                        }
>
>                }
>
> to show all column names but I'm not getting any relevant information.
> I can get the phone number (data 0 or data 1), but not first, middle,
> and last. I need to access as much of the user's data for the
> algorithm to work as it compares it with other people to find trends
> and patterns. The more complete the data the better.
>
> Here's another alternative way I tried with the first cursor c1:
>
> String lookup =
> c1.getString(c.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
> Cursor cc =
> getContentResolver().query(
> Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI,
> lookup), null, null, null, null);
>
> and still I cannot get the owner's or a contact's data that I want.
>
> I don't understand why the CommonDataKinds object is in the API when
> we can't even use these to fetch any contact's data:
> ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME
> ContactsContract.CommonDataKinds.StructuredName.MIDDLE_NAME
> ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME
>
>
> Does anyone have any clue as to why I can't get the contact fields I
> need... or how I can get them?
> I really appreciate any insight.
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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