0

I can open text file from external sd card, but I can't save it back to the same place because of error

can't create storage...
Permision denied

Is there a way to change app permission to saving files to external sd?

1
  • The app has to ask for permission. If it doesn't it's denied access to the external SD card.
    – GiantTree
    Commented Jan 30, 2017 at 19:23

1 Answer 1

0

To write to an external drive you need to add the necessary permissions to your manifest. To write you will want to add:

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

To read from the drive you should add:

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

You should be able to get away without the read permission but if you want to futureproof your app and make it so users don't run into bugs add it in. Google's API explains the proper guidelines for handling datafiles here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .