0

I just started looking at android app development. For my first test app i want to fetch a json object from a public rest api, e.g. Twitters.

Is there any way to deserialize the JSON in to an anonymous object? Or do i have to parse it manually and create a dictionary with key value pairs or something similar?

Thanks

Johan
  • 35,120
  • 54
  • 178
  • 293
  • If I understand what you asked correctly, for a similar problem of mine, answer to this question helped me a lot http://stackoverflow.com/questions/2255220/how-to-parse-a-json-and-turn-its-values-into-an-array – yildirimyigit Jun 17 '12 at 01:25

1 Answers1

0
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONArray;

...

final String string = getWebString(webHelper, ctx, args);

try {
    return new JSONArray(string);
} catch (JSONException e) {
    Log.e(TAG, "Malformated JSON string: " + string + ", e = " + e);
    Utils.where(e);
    return null;
}
Edward Falk
  • 9,991
  • 11
  • 77
  • 112