我开发一个应用程序,需要得到IMSI。我使用的:
I am developing an app that requires to get the IMSI. I use:
TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); String imsi = mTelephonyMgr.getSubscriberId();
这适用于大多数的手机,但也有少数手机只返回6位而不是15这是错误的。
It works for most phones, but a few handsets only return 6 digits instead of 15. Which is wrong.
任何人都知道以编程方式检索IMSI的另一种方式?其他的API?方法?
Anyone knows an alternative way to retrieve the IMSI programatically? Other APIS? methods?
问候
推荐答案根据这篇文章:www.anddev/tinytut_-_getting_the_imsi_-_imei_sim-device_unique_ids-t446.html
您可以使用
String imei = android.os.SystemProperties.get(android.telephony.TelephonyProperties.PROPERTY_IMSI);
但SystemProperties是不能直接访问的,所以你需要使用的招数,在回答这个问题一:的哪里是android.os.SystemProperties
该人士$ C $下类SystemProperties 这里:hi-android.info/src/android/os/SystemProperties.java.html
The source code for class SystemProperties is here: hi-android.info/src/android/os/SystemProperties.java.html
更多推荐
从android手机越来越IMSI?
发布评论