I have the output in following JSONObject format. I want to fetch each and every value in this JSONObject. How can I do it? Need help! Thank you in advance.
{
"410": 19082,
"443": 19097,
"667": 19172
}
I have the output in following JSONObject format. I want to fetch each and every value in this JSONObject. How can I do it? Need help! Thank you in advance.
{
"410": 19082,
"443": 19097,
"667": 19172
}
you can used below login for parsing key's value's of JSON
String json ="{\n" +
" \"410\": 19082,\n" +
" \"443\": 19097,\n" +
" \"667\": 19172\n" +
" }";
try {
JSONObject obj = new JSONObject(json);
for(int i = 0; i<obj.length(); i++){
Log.e("json parse", "Key = " + obj.names().getString(i) + " value = " + obj.get(obj.names().getString(i)));
}
}catch (Exception e)
{
e.printStackTrace();
}