1)Target set to Android Q with android.permission.WRITE_EXTERNAL_STORAGE
2) use getExternalStorageDirectoryor getExterna
If you use preserveLegacyExternalStorage, the legacy storage model remains in effect only until the user uninstalls your app. If the user installs or reinstalls your app on a device that runs Android 11, then your app cannot opt out the scoped storage model, regardless of the value of preserveLegacyExternalStorage.
Something to remember when using this flag. know more