一个简单的解JSON代码
private String test ="{\"method\":\"thing.event.property.post\",\"params\":{\"image\":\"/9j/\"}}";
private void parsetest(String test) {
//
try {
JSONObject jsonObj = new JSONObject(test);
JSONObject paramsObj = jsonObj.getJSONObject("params");
String image =paramsObj.getString("image");
StringBuilder data =new StringBuilder();
data.append("image:").append(image);
btnjsonTestText.setText(data.toString());
} catch (JSONException e) {
throw new RuntimeException(e);
}
}