Is there any way to convert a normal Java array or ArrayList to a Json Array in Android to pass the JSON object to a webservice?
ArrayList
My code to convert array to Json
Code
Lista = new ArrayList(); a.add("so 1"); a.add("so 2"); a.add("so 3"); JSONArray jray = new JSONArray(a); System.out.println(jray.toString());
output
["so 1","so 2","so 3"]