-2

How do I get Mobile number programmatically?

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

If you have gone through the link you posted and still can't get the phone number. It means that your phone number was not register in your mobile.For that you can use the sim card serial number.It is unique number.

    TelephonyManager telemamanger = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
    String getSimSerialNumber = telemamanger.getSimSerialNumber();  
cw fei
  • 1,534
  • 1
  • 15
  • 33
  • I know sim card number is a unique number but the requirement is mobile number. – Mohan Kumar Sep 18 '15 at 07:30
  • The method you are using is the only one part of the SDK to do this, and only works on devices where the number is stored on the SIM card, which only some carriers do. So if you can't get using the method, there's no alternative way i think – cw fei Sep 18 '15 at 07:32