I can create a JSON file in DCIM directory of Glass but the file is not visible when I access it on glass.
Here is the code:
File jsonFile = new File(Environment.getExternalStorageDirectory()
+ File.separator + "DCIM/test/file.json");
//file address
String json = "{\"id\":1}";
//text to be written on the file
FileWriter fw = new FileWriter(jsonFile);
BufferedWriter bw = new BufferedWriter(fw);
bw.write(json);
bw.close();
fw.close();
//writing the file
I can only access the file in DDMS view in Eclipse.
I have added the following permission:
android.permission.WRITE_EXTERNAL_STORAGE