首先我们看一下IMEI号和IMSI号是什么: 在Android中获取IMEI号方式如下: /** * 获取手机IMEI号 */ public static String getIMEI(Context context) { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(context.TELEPHONY_SERVICE); String imei = telephonyManager.getDeviceId(); return imei; }
在Android中获取IMSI号方式如下:
最后,获取IMEI号和IMSI号需要权限,记得在AndroidManifest.xml文件中加上权限: <uses-permission android:name='android.permission.READ_PHONE_STATE'/>
|
|
来自: 昵称69973406 > 《防骗类》