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. Deploying "assets" to Android device
Forum Updated to NodeBB v4.3 + New Features

Deploying "assets" to Android device

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

    I am loading my application "assets" from a sub-directory of the working folder (e.g. "workingFolderPath/res/images"... etc) by creating an URL (e.g. "file:///c:/something/something/workingFolder/res/images/image.png"). Now I want to deploy/test the application to an Android device.
    How can I deploy these "assets" to Android device with Qt Creator? I don't want to use Qt resources for that matter.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      "Here":https://community.kde.org/Necessitas/Assets for more informations

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • F Offline
        F Offline
        feldifux
        wrote on last edited by
        #3

        We used a hybrid approach for deployment to Android, which also works cross-platform:

        • the QML & JS files are put into qrc files (this also makes sure no one can read your source code)
        • the assets are put into an own assets folder and are deployed with DEPLOYMENTFOLDERS += assets in the .pro file

        That way, you don't have the size limitation of qrc files (at above ~50MB qrc hangs).
        Also, during development working with DEPLOYMENTFOLDERS is better on Desktop, because you can just re-run your application and dont need to recompile.

        What we did additionally, is to abstract the file access, i.e. you dont need a prefix assets:/... for your images, or mix up your code with any qrc:/... prefixes.

        You can have a look at some .pro files of our games by downloading the "V-Play SDK":http://v-play.net and then check out the <QtSDK>/examples/V-Play/demos directory.

        I've also posted some comments about the qrc approach set as default since Qt Creator 3.1 on the Qt Blog, maybe that's interesting to the pros and cons of it (and why I think it's bad..):
        http://blog.qt.digia.com/blog/2014/03/04/qt-creator-3-1-beta-released/#comment-1193034

        Founder of Felgo SDK - http://felgo.com/qt

        Felgo simplifies

        • Mobile App Dev with Qt esp. iOS & Android
        • Game Development with Qt

        What others say

        Felgo scored #1 in Cross-Platform App Development Tools Report - see why: https://goo.gl/rgp3rq

        1 Reply Last reply
        0
        • GianlucaG Offline
          GianlucaG Offline
          Gianluca
          wrote on last edited by
          #4

          I don't use qrc too, and this is my code into .pro for deploy to assets for Android:

          @

          Common data to insert into APK Assets

          COMMON_DATA.path = /assets
          COMMON_DATA.files = $$files($$PWD/BundleData/Common/*)
          INSTALLS += COMMON_DATA
          @

          Then you can access to the data installed using the "assets:/path/filename.ext" as path name.

          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