[android-developers] Re: How do I get the user's phone number?

2008-08-19 Thread Huebi
You need the permission READ_PHONE_STATE, then use TelephonyManager.getDefault() to get hold of the TelephonyManager. On the returned instance call mgr.getLine1Number() and there it is :) Cheers -Huebi On 19 Aug., 07:30, j [EMAIL PROTECTED] wrote: How do I get the user's phone number in 0.9

[android-developers] Re: How do I get the user's phone number?

2008-08-19 Thread Romain Guy
Do not use TelephonyManager.getDefault(), this is private API that may change. Instead use the following: (TelephonyManager) getSystemService(phone) On Mon, Aug 18, 2008 at 11:06 PM, Huebi [EMAIL PROTECTED] wrote: You need the permission READ_PHONE_STATE, then use

[android-developers] Re: How do I get the user's phone number?

2008-08-19 Thread Jeff Hamilton
You should get the TelephonyManger using getSystemService(TELEPHONY_SERVICE) instead, like this: TelephonyManager telephony = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); See http://code.google.com/android/reference/android/content/Context.html#TELEPHONY_SERVICE for the definition