How to store files in the shared file directory of Android?



  • 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 and android.permission.WRITE_EXTERNAL_STORAGE to the Manifest file.

    Unfortunately QStandardPaths::DocumentLocation doesn't work. The directory couldn't be created. The QStandardPaths::AppDataLocation works. A directory like data/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 and just myfile.txt. The second alternative returned a true for the writing process, but I couldn't find the file anywhere.

    has someone an idea?


 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.