首先,什么是设备ID(即AndroidId),经过查资料,百度看到有以下解释:
代码我放在命名为SystemUtil 的工具类中:
public static final String getAndroidID() {
String m_szAndroidID = Settings.Secure.getString(Utils.getContext().getContentResolver(), Settings.Secure.ANDROID_ID);
if (m_szAndroidID == null) {
return getUUID();
} else {
return m_szAndroidID;
}
}
在登录认证中调用,传参使用应该为:
Map<String, Object> map = new HashMap<>();
........//传递的其他参数
map.put("equipmentId", SystemUtil.getAndroidID());
截图信息来自添加链接描述