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. Equivalent of QMAKE_BUNDLE_DATA for android?

Equivalent of QMAKE_BUNDLE_DATA for android?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 1.0k Views 2 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.
  • timdayT Offline
    timdayT Offline
    timday
    wrote on last edited by
    #1

    I have a couple of Qt apps (simple C++ QQuickView hosting a bunch of QML with some C++ plugin components) building and running nicely for OSX and iOS, and including the QML and a bunch of supporting data files (not qrcs) into the app bundles using QMAKE_BUNDLE_DATA in the .pro files. On iOS I can find the location of the app's data files (slightly obscure due to the sandboxing) using QStandardPaths::standardLocations(QStandardPaths::DataLocation), and I have the application cwd to the QML location before it fires up and it all Just Works. (OK ok that does actually sound really hacky now I write it down... ).

    Just been taking my first steps with android. I have a .apk file building... but it doesn't contain any of the files referenced in the QMAKE_BUNDLE_DATA locations (so none of the QML making up the bulk of the application either).

    Is there some Android equivalent of QMAKE_BUNDLE_DATA ("bundle" apparently being Apple-world terminology), or some other approach supposed to be used? Should I just bite the bullet and force all the my QML and data into QRCs?

    I'm using Qt 5.7 and android-ndk-r10e (on Linux, currently) 'cos I saw some messages about later ndk's having some problems.

    Hmmm... I can see another problem brewing that one of the apps bundles around 1GByte of data, which apparently takes me into https://developer.android.com/google/play/expansion-files.html territory. But I'd settle for getting a proof of concept working with less data first.

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

      Hi,

      You can use the assets folder for that. Here you can find how.

      Hope it helps

      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
      • timdayT Offline
        timdayT Offline
        timday
        wrote on last edited by timday
        #3

        Thanks. That looks promising, but when I try it something seems to be expanding the paths so that if I'm working in in /home/mylogin/project/myapp/, it wants to install files like stuff/myapp.qml to assets/home/mylogin/project/myapp/stuff/myapp.qml rather than just assets/stuff/myapp.qml. Think this is more due my poor knowledge of qmake variable substitution (and when path-like things are expanded?) than anything else; I am actually trying to do

        INSTALLS += $$QMAKE_BUNDLE_DATA

        as I'm trying to reuse the lists of stuff to be packaged I already have from OSX/iOS builds, rather than rebuild a completely fresh list for android on a different macro.
        (It does indeed work as expected if I do a simple
        EXTRASTUFF.path=/assets/
        EXTRASTUFF.files=../NEWS.md
        INSTALLS += EXTRASTUFF
        though. But I don't want to do a huge unmaintainable cut-and-paste duplicate of all the stuff I have being added into QMAKE_BUNDLE_DATA currently, but into INSTALL... at least until I understand why the .path get expanded).

        For now, found a simpler solution in the form of just putting some cp -r <stuff> deploy/assets/ in my build script between the make install INSTALL_ROOT=deploy and the androiddeployqt.

        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