Answers for "how to create json file in android programmatically"

0

how to create json file in android programmatically

public void save(Context context, String jsonString) throws IOException {
  File rootFolder = context.getExternalFilesDir(null);
  File jsonFile = new File(rootFolder, "file.json");
  FileWriter writer = new FileWriter(jsonFile);
  writer.write(jsonString);
  writer.close();
  //or IOUtils.closeQuietly(writer);
}
Posted by: Guest on September-04-2020

Code answers related to "how to create json file in android programmatically"

Code answers related to "Javascript"

Browse Popular Code Answers by Language