I am developing an app that requires to get the IMSI. I use:
TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String imsi = mTelephonyMgr.getSubscriberId();
It works for most phones, but a few handsets only return 6 digits instead of 15. Which is wrong.
Anyone knows an alternative way to retrieve the IMSI programatically? Other APIS? methods?
Regards
On some Android phones, you can also access your IMSI through the Settings menu. Tap the "About" entry in the menu, then tap "Status" or "Phone Identity." The IMSI will be listed under IMSI if it's available through this menu. You can also get the IMSI on an Android phone by installing a specialized app.
1.TO CHECK FOR IMEI by Dailing *#O6# from your KEYPAD. 2. To check for IMEI from your phone settings. IMEI and IMSI can track your phone location hence, to stay anonymous it is advisable to change both SIM and PHONE.
The IMSI (International Mobile Subscriber Identity) is a code used by the phone company to identify the SIM on the mobile network. The IMEI (International Mobile Station Equipment Identity) is an international "Serial number" for your phone (device itself) to properly identify it on the carriers network.
According to this post you can use
String imsi = android.os.SystemProperties.get(android.telephony.TelephonyProperties.PROPERTY_IMSI);
but SystemProperties is not directly accessible, so you will need to use one of the tricks in the answers for this question: Where is android.os.SystemProperties
You may also need SystemProperties
source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With