문제

How can I save a json object in a file in sdcard?

도움이 되었습니까?

해결책

Just get a String from the JSONObject and write it into the file like this:

String content = json.toString();
FileWriter fw = new FileWriter("path");
BufferedWriter bw = new BufferedWriter(fw);
bw.write(content);
bw.close();

You will of course need to catch/throw exceptions and so on.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top