In SDK 29 (Aka Android_Q), The access to external storage using the method Environment.getExternalStorageDirectory()
is deprecated and no longer returns an accessib
You can use the flag android:requestLegacyExternalStorage="true"
in your manifest file.
This attribute is "false" by default on apps targeting Android 10 or higher.
However, in future versions of Android, this permission will not be available.
For next Android versions we should use scoped storage. More info here