I am trying to create folders and files in external storage directory through application.
File f = new File("/storage/emulated/0", mFileName);
boolean isCreated = f.mkdir();
This is always successful and isCreated is true with out any exception or warnings and folder is created.
Environment.getExternalStorageDirectory() returns "/storage/emulated/0" too.
But when I try to create folder in external storage card(removable memory card) as follows:
File f = new File("/storage/6161-3165", mFileName);
boolean isCreated = f.mkdir();
Always f.mkdir() returns false and the folder is not created. Meanwhile I can see W/System.err: ... in logcat as follows:
**02-22 14:50:47.551 13536-13536/com.testapp.extsd W/System.err: mkdir failed: EACCES (Permission denied) : /storage/6161-3165/uyyyy**
I have mentioned WRITE_EXTERNAL_STORAGE permissions in manifest file. Still folder is not created.
I want to know how to create folder and file in external card storage.
the file structure of storage in my mobile is:
shell@j7xelte:/storage $ ls -l
drwxrwx--x root sdcard_rw 2017-02-05 07:59 6161-3165
drwx--x--x root sdcard_rw 2016-01-01 17:34 emulated
drwxr-xr-x system system 2017-02-05 07:59 enc_emulated
drwxr-xr-x root root 2017-02-05 07:59 self
shell@j7xelte:/storage $
Waiting for the response...