Downloading qml files on Android and dynamically use them with QtQuick



  • 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?



  • 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.



  • 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?


Log in to reply
 

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