Reputation:
i'm trying to create an application about convert the json object to json array. If it's possible means tell me the way, otherwise, tell the alternate way. Thanks in advance.
Upvotes: 1
Views: 8887
Reputation: 24021
try this:
JSONArray jArrayObject = new JSONArray();
jArrayObject.put(getJsonObject());
private static JSONObject getJsonObject() throws JSONException {
JSONObject jObject = new JSONObject();
//put value jObject here..
}
Upvotes: 8