showing results for - "how to create json file in android programmatically"
Ewan
10 Jul 2019
1public void save(Context context, String jsonString) throws IOException {
2  File rootFolder = context.getExternalFilesDir(null);
3  File jsonFile = new File(rootFolder, "file.json");
4  FileWriter writer = new FileWriter(jsonFile);
5  writer.write(jsonString);
6  writer.close();
7  //or IOUtils.closeQuietly(writer);
8}