There is not a "phone's e-mail address." If the user downloaded your app from Market, they must have a Google account set up, but they may have multiple accounts. And anyway, that account is part of the Google services; this is not something that is part of the actual Android platform.
On Wed, Feb 9, 2011 at 11:10 AM, Kevin Duffey <[email protected]> wrote: > Heh..I started using that owner permission too.. glad to know it will be > gone (or is it gone in 2.3?). Question is, when a person buys a new android > phone, at least on Verizon, they generally can attach the phone to a google > account. Is there some way to get that particular users info, or is the only > way an app can do this is to ask for it from the user? > > I am messing around with an app where I'd like to send some data from phone > to a service, and some of that data is the owner of the phone's email > address. From what your saying Dianne, there is no way to discern this > information from the contacts database or accounts set up? So, the only way > to guarantee it every time is to ask for it in the app? > > Thanks > > > On Tue, Sep 7, 2010 at 5:49 PM, Dianne Hackborn <[email protected]>wrote: > >> Android has no concept of an "owner". Those permissions don't do anything >> (and will be gone in the next release). >> >> >> On Wed, Sep 1, 2010 at 12:11 PM, Dritan <[email protected]> wrote: >> >>> Hello, >>> >>> I'm writing an app on to make use of the owner's data (first, 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. >>> >>> 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 insights. >>> Thanks! >>> >>> -- >>> 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 >>> >> >> >> >> -- >> 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 >> > > -- > 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 > -- 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

