0

I am planning to get the Simcard number inserted in the android devices. So for that , i am trying this coding snippet,

TelephonyManager tm = (TelephonyManager)this.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); String phoneNumber= tm.getSimcardNumber();

my question is , Whether I can get Simcard Number of all the Network Providers or not. Please suggest me . Looking forward to the reply.

Regards Anand

user2462298
  • 41
  • 1
  • 1
  • 6
  • do you have an option that user enter his phone number himself, like viber did? because that might be better – Darko Rodic Sep 11 '13 at 12:54
  • It might not be working on some network operators as this information is embedded on sim card. So better look for some user input option. – Ashish Kumar Sep 11 '13 at 12:56
  • No no..I need to create a service if the user has changed the particular SImcard i need to intimate to others. So i asked.. – user2462298 Sep 11 '13 at 12:56
  • you might try get sim serial number, here's link http://stackoverflow.com/questions/5948446/to-get-phone-number-programatically-in-android?rq=1 because thats suppose to be unique – Darko Rodic Sep 11 '13 at 12:58
  • 'getSimcardNumber()' is not in TelephonyManager. Where did you get? – Pankaj Kumar Sep 11 '13 at 13:12
  • You might wish to explain what you think a "simcard number" is. Do you mean the IMSI? The IMEI? After all, there is no `getSimcardNumber()` on `TelephonyManager`, so we are having to guess what you mean by "simcard number". – CommonsWare Sep 11 '13 at 13:14
  • getSimSerialNumber() Returns the serial number of the SIM, if applicable. – user2462298 Sep 11 '13 at 13:18

1 Answers1

0

some of mobile network providers store sim number in their sim cards but lot of them dont did this because of network flexibility like MTN

you cant trust to functions like this . in same situation i used recieved text messages to get phone number

saber safavi
  • 452
  • 3
  • 8