When you say "this does not work" ... what exactly is happening? You mean that the program works without complaint, but the file is not written to the SD card, or do you mean something else?
If the file just doesnโt get there, this is not your mistake, this is the error of the phone manufacturer. I have seen several devices that return "/ mnt / sdcard" from getExternalStorageDirectory (), however this is not the true path to the SDK! For example, at least one Motorola device and on the Galaxy Tab (7 ") tab, for example, / mnt / sdcard, even if this indicates internal storage, and the external storage on each of these devices is / mnt / sdcard-ext.
There is nothing legal you can do about this - OEM is lying to you. If you want to hack the work, you can read / proc / mounts and try to find the actual path to the SD card, but / mnt / sdcard will also appear there, and there is no guaranteed way to distinguish true for all devices.
source share