I am trying to create an array like this [\"stringone\",\"stringtwo\"] and pass it to the webserver. When I tried doing making it with a string array like Str
[\"stringone\",\"stringtwo\"]
Str
If you want to create JSONArray from List or array, you can use constructor, which takes Collection:
JSONArray
List
Collection
String[] data = {"stringone", "stringtwo"}; JSONArray json = new JSONArray(Arrays.asList(data));