Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to store files in the shared file directory of Android?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 307 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • a.burksA Offline
    a.burksA Offline
    a.burks
    wrote on last edited by a.burks
    #1

    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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved