Originally Posted by poria1999
i am writing an app that needs to get sim cards phone number.
i tried this but its not working.
TelephonyManager telemamanger = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String getSimSerialNumber = telemamanger.getLine1Number();
it returns null....
i have tried every thing but nothing worked.
It should work, however there is no guarantee that phone number is physically stored on a SIM-card or broadcasted from the network to the phone.
Alternative solution might be to ask the user to enter phone number manually in case if telemamanger.getLine1Number() returns null.