I want to get access to public directory files, for storing not: image, audio and video! I need to store: documents (for example: doc, pdf, bak, zip, etc...). I need these documents should stay on user device even after my app will be uninstalled. And I need user can access these document files from other apps.
In early versions of android, for documents folder, I can simply write down next line:
File myDirectory = new File(Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_DOCUMENTS), "My documents");
if (!myDirectory.exists()) {
if(myDirectory.mkdirs()){
// directory exists, can place any files here
}
}
How can I do this in android Q? Or no way, and I just need to tell my users that my app doesnt support Android 10 at all?
p.s. I see this: getExternalStoragePublicDirectory deprecated in Android Q - No answer for my question