0
我的代碼 - 我試圖從JSON返回數據。如何從Amazon API Gateway的API中將此Dynamo DB數據解析爲Android?
JSONObject count = new JSONObject(finalJson);
JSONArray itemsArray = count.getJSONArray("Items");
JSONObject finalObject = itemsArray.getJSONObject(0);
String record = finalObject.getString("myid");
String vocabulary = finalObject.getString("vocab");
String method = finalObject.getString("method");
return record + vocabulary + method;
JSON我想parse-計數對象,項目陣列等..
{
"Count":1,
"Items":[
{
"myid":{
"S":"1"
},
"vocab":{
"S":"print a line"
},
"method":{
"S":"system.out.println"
}
}
],
"ScannedCount":1
你想回到什麼? –
我想返回1的ID記錄,打印一行和system.out.println。謝謝你的幫助! –
無法正確理解,請粘貼您的例外輸出以及您正在獲取的輸出內容。 –