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
java.io.FileNotFoundException: /filename (Read-only file system)
Try this:
File file = new File(filePath); File parent = file.getParentFile(); if (!parent.exists() && !parent.mkdirs()) { return; } file = new File(Helpers.StripExtension(filePath) + ".blk"); OutputStream fos = new FileOutputStream(file); fos.write(digest.getBytes()); fos.close();