how do I save a file in Android outside the app sandbox?
Firstly, you cannot save files in the external storage, it is related to Storage updates in Android 11, this update comes from native android's design.
But you can Request All files access. Note: the Google Play store has a policy that limits usage of this permission.
1.Declare the MANAGE_EXTERNAL_STORAGE permission in the manifest.
2.Use the ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION intent action to direct users to a system settings page where they can enable the following option for your app: Allow access to manage all files.
After that, you can save it in /storage/emulated/0/Documents
path.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.