• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

How to fetch own mobile number in android

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to get mobile number of own mobile.

I searched android telephony class but i can not find any useful function over there.

thanks in advance for your help.

Thanks,
Vimal Rajpara
 
Ranch Hand
Posts: 136
Android Mac Chrome
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vimal,
Hope you are fine.

This link is the solution of your problem



Thanks & Regards
Pratik Goswami
 
Rancher
Posts: 43077
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

This link is the solution of your problem


Not necessarily. That number can be the original phone number of the device, which becomes invalid if another (pre-existing) phone number gets ported to the phone - which is a common occurrence. I've also seen it reported as being "null" (which is OK according to the javadocs).
 
Pratik Goswami
Ranch Hand
Posts: 136
Android Mac Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf,

This is post condition, but something is there from which it can be accessed and achieved.

Returns the phone number string for line 1, for example, the MSISDN for a GSM phone. Return null if it is unavailable.



Thanks & Regards
Pratik Goswami
 
Ulf Dittmer
Rancher
Posts: 43077
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

This is post condition, but something is there from which it can be accessed and achieved.


I don't understand what you're trying to say here, but the important point is: No value may be returned, and even if a value is returned, it may not be the correct one.
 
Vimal Rajpara
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Pratik & Ulf for yours reply.

I am very much fine

as per my findings, both are right : if we have number listed in About Phone section of android then only we can get number other wise we get null.

The second thing i come across :- i checked one Android Mobile(@Pratik : its amitesh mobile) in that mobile owner changed its sim card but MSISDN number(mobile number) did not changed , it remain old sim card number. So in this scenario we can get mobile number of our own but old number.

 
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic