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 can I read/write data file from phone
Forum Updated to NodeBB v4.3 + New Features

How can I read/write data file from phone

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 4 Posters 1.7k 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.
  • W Offline
    W Offline
    wwwronin
    wrote on last edited by
    #1

    My application needs to read some configuration files(*.xml) from phone storage disk, how can I load them? I want to use relative file path like windows project,such as ./data/config ..

    1 Reply Last reply
    0
    • X Offline
      X Offline
      Xander84
      wrote on last edited by
      #2

      use QFile?
      sorry for the stupid answer but you didn't even specify if you use QML or just widgets or whatever, but in the end you just use a QFile that works well on mobile platforms, the same ways as on desktop platforms!?

      1 Reply Last reply
      0
      • K Offline
        K Offline
        k1mray2000
        wrote on last edited by
        #3

        Depending on what you need, this may be helpful
        http://qt-project.org/doc/qt-5/QStandardPaths.html

        1 Reply Last reply
        0
        • timdayT Offline
          timdayT Offline
          timday
          wrote on last edited by
          #4

          If you're targetting iOS:

          • I found https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html worth a read.

          • I've been putting files of all kinds (txt, qml, jpg) into my app bundle using the qmake support for doing that ( QMAKE_BUNDLE_DATA ) and have had no problem reading them using the usual Qt file tools (apps seem to start up with their CWD set in the bundle).

          Haven't touched android myself.

          1 Reply Last reply
          0
          • W Offline
            W Offline
            wwwronin
            wrote on last edited by
            #5

            Thanks for timday . I searched in website,and put my data files into sdcard .I set the data path as "./mnt/sdcard",that takes effects.

            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