{
"brandInfo":{
"brand":"品牌",
"model":"型号",
"deviceId":"0007A8947C62"
}
}
这是对象,用jsonObject解析
{
"m2mAppVersion": "",
"devices": [
{
"deviceId": "C00000000001",
"userId":"6553387",
"deviceName": "MaTest",
"deviceCategory": "0524",
"attr":{
"brand":"haier",
"model":"H_0.0.1"
}
},
{
"deviceId": "C00000000001",
"userId":"6553387",
"deviceName": "MaTest",
"deviceCategory": "0524",
"attr":{
"brand":"haier",
"model":"H_0.0.1"
}
}
]
}
这是数组,devices有多个设备,不能用一个device对象表示,中括号本身就表示数组,这里也表示数组,用jsonArray解析