Android 10.0之后系统获取不到IMEI和UUID解决办法
Android 10.0以后版本无法通过tm.getDeviceId();获取,所以要通过androidId来代表唯一性,如下:TelephonyManager tm = (TelephonyManager) LoginActivity.this.getSystemService(TELEPHONY_SERVICE);mtyb = android.os.Build.BRAND;...
·
Android 10.0以后版本无法通过 tm.getDeviceId();获取,所以要通过androidId来代表唯一性,如下:
TelephonyManager tm = (TelephonyManager) LoginActivity.this.getSystemService(TELEPHONY_SERVICE);
mtyb = android.os.Build.BRAND;// 手机品牌
mtype = android.os.Build.MODEL; // 手机型号
// imei = tm.getDeviceId();//uuid
imei = Settings.System.getString(
getContentResolver(), Settings.Secure.ANDROID_ID);//10.0以后获取不到UUID,用androidId来代表唯一性
更多推荐


所有评论(0)