String FILENAME = "settings"; String string = "hello world!"; File sdDir = new File(Environment.getExternalStorageDirectory().getPath()); File testDir = new File(sdDir.getAbsolutePath() + "/mobile_recont"); testDir.mkdir(); FILENAME = testDir + "/"+ FILENAME; try { FileOutputStream fos = new FileOutputStream(FILENAME); fos.write(string.getBytes()); fos.flush(); fos.close(); } catch (IOException e) { Log.e("Controller", e.getMessage() + e.getLocalizedMessage() + e.getCause()); }
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
java.io.FileNotFoundException: /mnt/sdcard/mobile_recont/settings: open failed: EACCES (Permission denied)
Environment.getExternalStorageState() = "removed"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)