Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting IMSI from android phone?

Tags:

android

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

like image 691
omega Avatar asked Apr 13 '11 22:04

omega


People also ask

How do I get IMSI on my phone?

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.

How do I find my IMEI and IMSI?

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.

Is IMSI the same as IMEI?

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.


1 Answers

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.

like image 196
Aleadam Avatar answered Nov 16 '22 00:11

Aleadam