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 read/write "/data/data/com.my.app/files/<file>" android by c++ in qt
Forum Updated to NodeBB v4.3 + New Features

How to read/write "/data/data/com.my.app/files/<file>" android by c++ in qt

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 562 Views 1 Watching
  • 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.
  • Quang PhuQ Offline
    Quang PhuQ Offline
    Quang Phu
    wrote on last edited by Quang Phu
    #1

    Hi all,

    My android app need to read/write file in /data/data/com.my.app/files/ (as I know this is current folder of android app)
    So how can I do it in Qt by C++?
    My info:
    Qt 5.14
    NDK: 20r

    Thanks.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      Leonardo
      wrote on last edited by
      #2

      You should do it as you would with any other file, but you should not hard code this path. You should use QStandardPaths::writableLocation().

      1 Reply Last reply
      3
      • Quang PhuQ Offline
        Quang PhuQ Offline
        Quang Phu
        wrote on last edited by
        #3

        Hi @Leonardo,

        It worked, thank you so much

        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