Skip to content

Instantly share code, notes, and snippets.

@simonewebdesign
Last active December 14, 2015 14:09
Show Gist options
  • Save simonewebdesign/5098736 to your computer and use it in GitHub Desktop.
Save simonewebdesign/5098736 to your computer and use it in GitHub Desktop.
JSONObject o = new JSONObject();
JSONArray a = new JSONArray();
try {
o.put("foo", "bar");
o.put("bool", false);
a.put(1, 123.45);
a.put(2, 123);
o.put("ArrayList", a);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Log.v(TAG, o.toString());
Log.v(TAG, a.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment