I am trying to validate the user has the sim card in their android phone's sim slot while using our application Like GPay, the Phonepay app will throw an error when we removed the sim card from the device
In most cases, I am getting security exceptions and a blank or null string in the latest android versions
TelephonyManager tMgr = (TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE);
String mPhoneNumber = tMgr.getLine1Number();