[Solved] How to create JSONObject in Android?


Creating json object

JSONObject obj = new JSONObject();

adding values into json object

obj.put("key", "your_value");

please see this answer

EDITED

This may be help you

JSONArray array = new JSONArray();
array.put(obj);
JSONObject par_obj= new JSONObject();
par_obj.put("data",array); 

1

solved How to create JSONObject in Android?