Skip to content Skip to sidebar Skip to footer

How To Check And Request Read, Write Permission For Sd Card In Platform >= 23 Of Android

I have the following code to request read,write permission for external(shared) storage known as emulated. Now I also want to read and write to SD Card. But i am getting the error

Solution 1:

    /storage/8E14-3919/database.db .

Even if you have all the permissions for external storage then still you will not be able to write on the micro SD card on that place.

You can only write in the app specific directory on the card.

To find that path use getExternalFilesDirs(). If you are lucky it is one of the entries returned.

For you the path would look like

 /storage/8E14-3919/Android/data/<packagename>/files

Have a look with a file explorer app. It is probably already there.

If you want to write everywhere on the card use the storage access framework.

Post a Comment for "How To Check And Request Read, Write Permission For Sd Card In Platform >= 23 Of Android"