i have this json : {"id":1,"name":"john smith"}
How i can parse it? i know i have to do this with this function:
public static String parseJSONResponse(String jsonResponse) {
String name = "";
JSONObject json;
try {
json = new JSONObject(jsonResponse);
JSONObject result = json.getJSONObject("**********");
name = result.getString("**********");
} catch (JSONException e) {
e.printStackTrace();
}
return name;
}
but i dont know what can i put in the areas incated with "****". please help me
i only want to fetch id and name values.