Android Question Android 11 - How to create folder for database backup and storing user files?

anglia

Member
Licensed User
Longtime User
I’m writing an app that needs a folder(s) that can-

1. Store a backup copy of an SQLite database
2. Allow the user to copy CSV files into the folder for import into the database
3. Store PDF files produced by the app for printing by the user.

I could see how to do this before Android 11 came along. I don’t know the best method for Android 11 users. I don’t have an Android 11 device so I can’t test the app.

Would using ‘GetSafeDirDefaultExternal ‘ to create a folder be the best way to enable the user to access the files?

I’d be very grateful for any advice and suggestions.

Thanks.
 

anglia

Member
Licensed User
Longtime User
Thanks Erel,

Seems I was lucky posting when I did!

I've downloaded your example. I assume it will work ok on Android 11?

Are there any restrictions with Android 11 on accessing ANY folder for importing a CSV file for example?

Thanks
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I assume it will work ok on Android 11?
Sure.

Are there any restrictions with Android 11 on accessing ANY folder for importing a CSV file for example?
ANY folder -> no such thing. There are many restricted folders.

The secondary storage (external storage) is accessible with ContentChooser. No special restrictions.
 
Upvote 0

anglia

Member
Licensed User
Longtime User
Sorry Erel. I should have been clearer.

What I meant was any folder created by my app or the user.

Thanks
 
Upvote 0
Top