机智云Android APP获取设备状态的问题
我在机智云上建的虚拟设备对应的Android APP,在扫码绑定虚拟设备后,我获取虚拟设备的“状态”的时候,机智云返回APP的数据是JSON:{binary=[B@41677770},里面貌似没有我需要的数据,请问这个JSON数据是什么意思呢?楼主的获取方式可能不太对?
要不要试试下面这个?
if (dataMap.get("binary") != null) {
byte[] binary = (byte[]) dataMap.get("binary");
Log.i("IOEDemo","Binary data:"+ bytesToHex(binary, 0, binary.length));
}
public static String bytesToHex(byte[] bytes, int offset, int count) {
char[] hexChars = new char;
for (int j = 0; j < count; j++) {
int v = bytes & 0xFF;
hexChars = hexArray;
hexChars = hexArray;
hexChars = ' ';
}
return new String(hexChars);
}
页:
[1]