I second this. On the G1, it returns a bogus phone number (somewhat
similar to that on the emulator).
Here's the code:
TelephonyManager tm = (TelephonyManager)
activity.getSystemService(Context.TELEPHONY_SERVICE);
String phoneId = tm.getLine1Number();
I've got the following in the manifest file:
<uses-permission
android:name="android.permission.READ_PHONE_STATE" />
The value I receive is:
1 (857) 445-3609
which is _not_ the MSISDN or the phone number.
I'm guessing it's a bug that needs to be fixed ASAP?
Stan
On Oct 23, 6:59 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> Danny wrote:
> > I am trying to get the user'sphonenumberto use as UID and it seems
> > to work in the emulator but not in the actual device, is it a bug or
> > am I doing something wrong? My piece of code is here...
>
> > TelephonyManager mTelephonyMgr =
> > (TelephonyManager)
> > getSystemService(Context.TELEPHONY_SERVICE);
> > String phoneNum = mTelephonyMgr.getLine1Number();
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---