I am trying to create this JSON object on android. I am stuck on how to add a string array in the object.
A = { \"class\" : \"4\" , \"name\" : [\"joh
You are getting error because of this.
school.put("name", ["john", "mat", "jason", "matthew"] ); ^ ^
Do like this.
school.put("name", new JSONArray("[\"john\", \"mat\", \"jason\", \"matthew\"]"));