thank's for your reply, but in my application, i want to let user can
submit his phone number without input, so others can phone him if
necessary

On 11月20日, 下午1时50分, Marc Lester Tan <mail...@gmail.com> wrote:
> I think some carriers don't provide the MSISDN to the handset so I guess you
> shouldn't rely on it. Just use the IMSI and device id to identify the user.
>
> Marc
>
>
>
> On Thu, Nov 19, 2009 at 11:40 PM, rodger <rodge...@gmail.com> wrote:
> > I want to use phone number as user ID,so i want to access the phone
> > number.
> > in my code,  i can get IMSI (International Mobile Subscriber Identity)
> > by using getSubscriberId().
> > but can not get  MSISDN by using  getLine1Number(),it returns null.
>
> >  my test phone is HTC G3,
> > anybody can solve the problem?
>
> > thanks!
>
> >  TelephonyManager tm = (TelephonyManager) getSystemService
> > (Context.TELEPHONY_SERVICE);
>
> >        String phoneNumber = tm.getLine1Number();
> >        if(phoneNumber == null || phoneNumber.trim().equals("")){
> >                phoneNumber = "cann't get the phone number";
> >                }
>
> > // permission has been added in Manifest
> >  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Beginners" group.
> > To post to this group, send email to android-beginners@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr­...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-beginners?hl=en- 隐藏被引用文字 -
>
> - 显示引用的文字 -

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to