Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Downloading qml files on Android and dynamically use them with QtQuick
Forum Updated to NodeBB v4.3 + New Features

Downloading qml files on Android and dynamically use them with QtQuick

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.3k 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.
  • D Offline
    D Offline
    DerMas
    wrote on last edited by
    #1

    I'd like to build a flexible app, which uses a Loader to access qml files, which are dynamically placed into the filesystem. On a desktop pc, this is not a problem, since all qml files which are placed inside of the qtquick project are automatically recognized and can be used directly.
    But on Android, I cant access the qml project inside of the apk. So where would I put new qml files on android and how would I access them?

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

      I think the easiest way is to let the app itself save the files in the app directory!?Usually apps are running in a sandbox and you don't have access to the app directory from outside of the app, but in your case that depends where the files are coming from and and what do you want to do with it. If you have to download the files anyway, you could simply save them locally with QFile("filename.qml") and that works, I have no idea where the file will be saved on the android platform, but you can access it again unless you uninstall the app the the files get also deleted.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DerMas
        wrote on last edited by
        #3

        Thanks, I'll try that and hope that the Loader can find the downloaded files :)

        Edit:
        Ok, I have downloaded the qml file and now I know where it is saved:
        "/data/data/org.qtproject.example.MyApp/files"
        So it is placed into the private app directory. But how can I access this qml file now from my qml application?

        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