While trying to write file to sdcard I get java.io.FileNotFoundException: /filename (Read-only file system) exception. Sadly none of the many solutions posted h
Great, I've had the exact same problem some time ago. Path delimiter (or whatever it's called) is missing.
File file = new File(Environment.getExternalStorageDirectory() + "test_file.blk");
didn't work, but
File file = new File(Environment.getExternalStorageDirectory() + "/test_file.blk");
performed well
Also:
FileWriter f = new FileWriter(Environment.getExternalStorageDirectory().getPath()+ "/foobar");
f.append("stuff");
f.close();
Works fine etc.
I think exceptions said it's readonly, because root filesystem is readonly indeed.
NOTE:
java.io.FileNotFoundException: /foobar (Read-only file system) means we are writing to the system root
java.io.FileNotFoundException: /mnt/sdcard/foobar (Read-only file system) means sdcard root (I didn't get this exception it's just an example)
tl;dr wrong path