public static void writeFile(String fileName, String path, List list) { try { String filePath = path + fileName; File destdir = new File(path); if (!destdir.exists()) { destdir.mkdirs(); } OutputStream output = new FileOutputStream(filePath); StringBuffer sb = new StringBuffer(); JSONArray arrayStr = convertListToJson(list); for(int i = 0; i< arrayStr.size(); i++){ sb.append(arrayStr.get(i).toSt..