Get Android Device Id
public static String getDeviceId() {
String deviceId = android.os.Build.MANUFACTURER + "/" + android.os.Build.MODEL;
if (deviceId != null)
deviceId = deviceId.toLowerCase();
String bid = Build.ID;
Pattern pattern = Pattern.compile(".*[A-Z][A-M][0-9]$"); // check if match SAMSUNG binary id rules or not
Matcher matcher = pattern.matcher(bid);
if(Build.BRAND.toLowerCase().equals("samsung") && Build.DEVICE.toLowerCase().startsWith("cs02")
&& !matcher.find() && Build.VERSION.SDK_INT == 19){
deviceId = "yeshen/simulator" + "/" + android.os.Build.MODEL + "/" + android.os.Build.PRODUCT + "/" + android.os.Build.DEVICE + "/" + android.os.Build.VERSION.SDK_INT + "/" + System.getProperty("os.version");
}
return deviceId;
}
if (getDeviceId().equals("xiaomi/mi 9")){
Log.i("Debug", "getDeviceId: %s", getDeviceId()));
}
本文标题:Get Android Device Id
本文链接:https://www.haomeiwen.com/subject/sswofctx.html
网友评论