如何获取Android唯一标识

2025-05-23 15:43:19
推荐回答(1个)
回答1:

public static String getIMEI(Context context){
TelephonyManager TelephonyMgr = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
String szImei = TelephonyMgr.getDeviceId();
return szImei;
}
通过这个就获取了手机唯一标示了,同时你还要在AndroidMainifest.xml中声明权限