1

I read the documentation and also searched for a potential solution. However, it's still not clear how to deal with. In my project, I used these permission lines in the app's AndroidManifest.xml

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

to give corresponding accesses. Also, I handle those permissions in onRequestPermissionsResult() to ensure that the user allows them. However, recently I go this warinig

WRITE_EXTERNAL_STORAGE no longer provides write access when targeting Android 10, unless you use requestLegacyExternalStorage

My app supports Android versions 21+ and seemly Android 10 and above versions do not require above mentioned permissions.

How can I deal with the requestLegacyExternalStorage and android.permission.WRITE_EXTERNAL_STORAGE /> to keep functionable for all supported Android versions (21 and above)?

halfer
  • 19,824
  • 17
  • 99
  • 186
Mark Delphi
  • 1,376
  • 1
  • 11
  • 29
  • 1
    "and seemly Android 10 and above versions do not require above mentioned permissions" - this is untrue and based on use case : https://developer.android.com/training/data-storage. The documentation is a bit of a mess with pockets of information in different places as the permissions and storage models have changed. This is related to this question and answers : https://stackoverflow.com/q/63364476/4252352 – Mark Jan 05 '21 at 11:44

0 Answers0