0

According to https://developer.android.com/preview/privacy/scoped-storage, an app with sandboxed view can just access files located in app-specific directory or Media collections or Downloads in Android Q.

I'm just confused if I want to keep app files after app being uninstalled where can I write my files, except Media or Downloads directory.

Writing files in inappropriate location is bad, so this question is just to find if it's possible when app works with scoped storage.

RachelHq
  • 3
  • 1

1 Answers1

1

I want to keep app files after app being uninstalled where can I write my files

Use the Storage Access Framework (e.g., ACTION_CREATE_DOCUMENT or ACTION_OPEN_DOCUMENT_TREE). This will allow the user to choose where your app writes the user's data on the device, and most locations that the user might pick will remain around after your app is uninstalled.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 2
    Thank you for the answer. We can create files in locations remained after uninstallation this way, but users can see the system picker. Is it possible to create files in these locations **secretly** in Android Q? Thanks~ – RachelHq May 14 '19 at 04:20