I'm developing an app that can download some media files to the user selected folder (User selects folder using the SAF), targeting android 11+. It can download and create files on primary external shared storage (e.g. path: /storage/emulated/0/Download/) just fine. But when user selects a folder on the removable microSD card (e.g. path: /storage/XXXX-XXXX/Documents/) creating of files finishes with error (Cannot create file: /storage/9016-4EF8/...). Probably the reason of this error is denied permissions. I found tons of articles about android storage and came to the conclusion that apps can't create files at any folder on microSD card except the internal storage of the app on that sd card.
Summarising all above:
I can create files here:
path = "/storage/emulated/0/Download/" // primary external shared storage
path = "/storage/emulated/0/Android/data/com.app.app/files" // primary internal storage
path = "/storage/XXXX-XXXX/Android/data/com.app.app/files" // secondary internal storage on removabled microSD
I can't create files here:
path = "/storage/XXXX-XXXX/Download/" // secondary external shared storage
Since android 11+ internal storage of my app is no longer accesible from other apps. So for example picture downloaded using my app to the app folder can not be opened through any ImageEditor or Gallery. So the only way to correctly store files is to choose primary external shared storage.
The question is that some users has an external storage with max 2GB in size, they just need to download files to a microSD card. Is there any way to do it or is Android really such a dumb platform?
P.S. I am developing the app using QT C++, so files are created using standard C++ functions.
P.S.S. Sorry for my english