0

I am creating a FileManager app, where i am creating copy and cut functionality its working fine in internal device storage but when i try to copy something in external storage it says Permission denied. I have all the write permissions granted.

How can i write in external storage?

manmeet singh
  • 86
  • 1
  • 3
  • Can you post the relevant code parts? Without it we can help you much...also which android version are you testing this code etc...are you handling the runtime permissions that are required to be approved by user? – JanBo Jan 26 '18 at 11:53
  • ohk i will put that part – manmeet singh Jan 26 '18 at 15:08

1 Answers1

0

It depends what you mean by external storage. If you mean the external storage on the internal SD card, then

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

in the manifest should be sufficient, assuming it is also granted in the App's security settings for Marshmallow and later.

On the other hand, if you mean an external removable SD card, then you will almost certainly not be able to write to it on KitKat or later unless you have taken specific steps to make it writeable.

There is a good summary of the state of play with removable SD cards here, which I suggest you take a look at: How does storage access change on Android 6.

AGDownie
  • 528
  • 4
  • 9