响应字符串是这样的:我得到如下所示的HTTP响应字符串。我想从响应字符串subject_id和状态字符串
{
"images": [
{
"transaction": {
"status": "success",
"topLeftX": 325,
"topLeftY": 451,
"gallery_name": "Ironman",
"subject_id": "Tony",
"confidence": 0.99414,
"height": 630,
"width": 630,
"face_id": 1,
"quality": 1.75477
},
"candidates": [
{
"subject_id": "Tony",
"confidence": 0.99414,
"enrollment_timestamp": "1487644861022"
},
{
"subject_id": "Tony",
"confidence": 0.99414,
"enrollment_timestamp": "1487644876280"
}
]
}
]
}
我想这个代码,但没有工作..
JSONArray arr = new JSONArray(response);
JSONObject jObj = arr.getJSONObject(0);
String status = jObj.getString("status");
String message = jObj.getString("subject_id");
你有没有考虑过使用像Gson这样的JSON解析器? –
什么工具用于呼叫Web服务? –
不,我不知道很多关于GSON..can请你给我说说如何在这个problem..Thanks使用GSON快速回复 – MRP192