How to store files in the shared file directory of Android?
-
wrote on 6 Sept 2019, 09:29 last edited by a.burks 9 Jun 2019, 09:51
I use the the QStandardPath approach to identify the directory and the FileIO approach to store files. Further more I have added
android.permission.WRITE_USER_DICTIONARY
andandroid.permission.WRITE_EXTERNAL_STORAGE
to the Manifest file.Unfortunately
QStandardPaths::DocumentLocation
doesn't work. The directory couldn't be created. TheQStandardPaths::AppDataLocation
works. A directory likedata/user/0/com.mycompany.myapp/files
is created. The write process returns true and I can find a directory/sdcard/Android/data/com.mycompany.myapp/files
respectively/storage/self/primary/Android/data/com.mycompany.myapp/files
but not the stored file itself. Surprisingly I can read the file with after writing it. But it doesn't appear in the file system.Previously I tried to store a file without the
QStandardPath
stuff by defining the path my self with/sdcard/myfile.txt
andjust myfile.txt
. The second alternative returned a true for the writing process, but I couldn't find the file anywhere.has someone an idea?
1/1