Re: [android-developers] Re: TelephonyManager.getLine1Number() returns null always
Hi Raghav,
I am also using TelephonyManager.getLine1Number() method to get current mobile number.
But it is returning empty string always as in setting it displayed Unknown for My Phone Number.
I need current mobile number to initiate the call. I have to initiate a call to current number only.
So please let me know if you have any work around regarding this.
On Wednesday, 4 January 2012 14:43:29 UTC+5:30, Raghav Sood wrote:
Why do you need this? Are you trying to uniquely identify individual installs? If so, what will you do if your user doesn't have a SIM in his phone, or is on a tablet? Search the list. Identifying installs uniquely has been discussed before.FYI, to see if the carrier stores the number on your SIM, go to Settings -> About Phone -> Status -> My phone Number (In ICS. Other versions may vary slightly.) If it displays unknown there, then your number is not stored on the SIM.ThanksOn Tue, Jan 3, 2012 at 4:46 PM, Upendra <upendra...@gmail.com> wrote:I had given read phone state permission for this. still i am getting
null not empty string.
In android we can get sim serial number. So, is there any third API to
get the mobile number which is associated with SIM serial number.
On Jan 3, 6:47 am, Vadim <vadimk11...@gmail.com> wrote:
> Seems line a (lack of) permission problem. For GSM, the phone number
> is on the SIM card, and some carriers just don't put it on the card,
> and then the phone does not know what it is, but in this case you
> should get an empry string rather than a null.
>
> On Jan 2, 3:18 am, Kristopher Micinski <krismicin...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Some devices just do this,
>
> > what device are you using?
>
> > Also, you should have the read phone state permission for this, though
> > if you didn't have it the result should be a security exception rather
> > than this null behavior (unless I'm forgetting that the api silently
> > checks for the permission, however, I think this is not the case...)
>
> > kris
>
> > On Mon, Jan 2, 2012 at 6:13 AM, Upendra Reddy Vuyyuru<upendraredd...@gmail.com > wrote:
> > > Hi All,
>
> > > I am trying to fetch the telephone number of the device. I am calling
>
> > > TelephonyManager.getLine1Number() it always returns null.
>
> > > Thank you in advance....
>
> > > Regards
> > > Upendra Reddy.V
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-d...@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscribe@googlegroups.com
> > > 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 android-d...@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en --
Raghav Soodhttp://www.androidactivist.org/ - Authorhttp://www.appaholics.in/ - Founder
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home