Android : File permissions with glass gdk

on Sunday, October 12, 2014


With the code below I can create a test.json file, but the file is not visible when I access the DCIM directory on glass.



File jsonFile = new File(Environment.getExternalStorageDirectory()
+ File.separator + "DCIM/test/file.json");
String json = "{\"id\":1}";
FileWriter fw = new FileWriter(jsonFile);
BufferedWriter bw = new BufferedWriter(fw);
bw.write(json);
bw.close();
fw.close();


I can only view the file accessing with the DDMS in eclipse.


I using the permission:


android.permission.WRITE_EXTERNAL_STORAGE


0 comments:

Post a Comment