I am trying find some vin data from http://developer.edmunds.com/ using https://api.edmunds.com/v1/api/toolsrepository/vindecoder?vin=1GCEC19C17Z275639&fmt=json&api_key=my_api_key.... I am getting a full json data. I am using simplest way to read json from a URL in java JSONParser and my return data looks like http://pastebin.com/30jXEGvN this.
What is the best way to print all keys and its values from a jsonobject ?
I tried
Iterator<?> keys = object.keys();
while( keys.hasNext() ){
String key = (String)keys.next();
try {
if( object.get(key) instanceof JSONObject ){
detailsTextOut.append(key);
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
But its not working for me :( , any clues ?