📌  相关文章
📜  如何以编程方式在 android 中创建 json 文件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:29.985000             🧑  作者: Mango

代码示例1
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);
}