1

I am trying to access my OWN contact information (my local profile) such as display name, phone number, email address, and other personal data (address, IM, website, notes, etc). I am not trying to access available contacts info using contact picker, etc.

lanzz
  • 42,060
  • 10
  • 89
  • 98
Nizzy
  • 1,879
  • 3
  • 21
  • 33
  • Where do you have this stored in the phone? You can't just ask the SDK for the phone number, for starters. – James Black Jun 03 '12 at 20:58
  • 1
    In the People app in the phone, there are first one which is my own info and my contacts. I am trying to extract my own data. – Nizzy Jun 03 '12 at 21:06
  • You can search your contacts for your own phone number and carrying on from there (as for the My Contact Card: http://stackoverflow.com/q/2809556/1267661). But I don't know of any way to find the phone number of a phone running the app (See: http://stackoverflow.com/q/2480288/1267661). – Sam Jun 03 '12 at 21:08
  • BTW, I know how to get my own phone number, but I am trying to access all my personal profile information. Thanks – Nizzy Jun 03 '12 at 21:12
  • Use Method B from: http://stackoverflow.com/questions/2112965/how-to-get-the-android-devices-primary-e-mail-address/2175688#2175688 – CommonsWare Jun 04 '12 at 00:22

1 Answers1

1

This is not supported by the Android platform till ICS. However there are some ways:

  1. Get the device google account email and check the device for that account. If a contact contains an account with that email address, it means that is the device owners account.

  2. If you are using ICS, ContactsContract.Profile can get you the owner profile data.

  3. If your sim supports, get the GSM number of sim from telephony manager and look up that number in contacts to get the device owner contact .

ozmank
  • 763
  • 1
  • 8
  • 23