JSONObject param = new JSONObject();
String[] strArray = null; strArray = service.substring(1, service.length() - 1).split(","); JSONArray locationArr = new JSONArray(); for (int i=0;i<strArray.length;i++){ locationArr.put(Integer.parseInt(strArray[i].trim())); } param.put("ServiceScope", locationArr);