0

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

1 Answers1

0

I think a major part of your problem's solution is available here: link
Check it out.
Hope it solves the issue.

S-Men
  • 111
  • 1
  • 5