Good day. A Transcend 8GB micro SD card is inserted into the phone. How to get to it correctly the way to which you can turn to write? I can not access it to write. I connected via ADB to the computer and found two directories with the contents of the SD card: /storage/2067-15E4 and /mnt/m_external_sd , and when I try to write something in these directories (for example, create a file in them), an exception occurs:

 java.io.IOException: open failed: EACCES (Permission denied) at..... Caused by: android.system.ErrnoException: open failed: EACCES (Permission Denied) at..... 

Here is this Environment.getExternalStorageDirectory() returns me only the path to the internal SD card. Need a way to the outside. Tell rwd how to get full access ( rwd ) to the SD card.

    1 answer 1

    Look here . Did you add <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> to the manifest?

    If the phone is version 6.0 and higher, then read about runtime permission (after reading, I advise you to familiarize yourself with the PermissionUtil library).