Android中获取IMSI和IMEI

TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

String imsi = mTelephonyMgr.getSubscriberId();
String imei = mTelephonyMgr.getDeviceId();
Log.i("IMSI", imsi);
Log.i("IMEI", imei);

==============================================================================

另外不要忘了在AndroidManifest.xml中加上读取手机状态的权限

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

posted @ 2015-06-16 19:09  网络虫  阅读(869)  评论(0编辑  收藏  举报