Khalid Taha Khalid Taha - 1 year ago 73
Android Question

Android Get Phone SIM number

How can I get The SIM card number using code ??
I tried this code and it returned no number

TelephonyManager tMgr =(TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE);
mPhoneNumber = tMgr.getLine1Number();

Answer Source


TelephonyManager phoneManager = (TelephonyManager) 
String phoneNumber = phoneManager.getLine1Number();

Needs READ_PHONE_STATE permission.