My application writes files to DCIM/SUBDIR
like camera does. It was working fine before Android 10. Now it doesn't see the contents of this directory and produces
java.io.FileNotFoundException: /storage/emulated/0/DCIM/SUBDIR/myfile: open failed: EACCES (Permission denied)
How to overcome? I can't allow user to select file, because my workflow is like in camera: you are not selecting filename on each picture taken. So I probably can't use Storage Access Framework
?
Try to add below key in <application>
tag of AndroidManifest.xml
<application android:requestLegacyExternalStorage="true"
File access in Android 10 is based scoped storage
standard.
Please check this out
This will work only for Android 10. It will not work if you set target version to 11. Check this.