java – Android code to get mobile number programmatically-ThrowExceptions

Exception or error:

How do I get Mobile number programmatically?

How to solve:

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();  

Leave a Reply

Your email address will not be published. Required fields are marked *