1

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.

1

1 Answer 1

8

try this:

JSONArray jArrayObject = new JSONArray();
jArrayObject.put(getJsonObject());

private static JSONObject getJsonObject() throws JSONException {
    JSONObject jObject = new JSONObject();
    //put value jObject here..
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.