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. Qt Android .qrc file images and other ressources
Forum Updated to NodeBB v4.3 + New Features

Qt Android .qrc file images and other ressources

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

    Hi, i have an app that was running on Symbian and now i like to port it to android.
    the app has about 600 images (70Mb) (eBOOK)
    I like to know what is the best way to include all the images in the .APK without adding the images to the .QRC file
    and how i can access the images from the QML files

    my files :
    main.ccp

    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    
    int main(int argc, char *argv[])
    {
        QGuiApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
        engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    
        return app.exec();
    }
    

    Ressources
    --qml.qrc
    ----/
    ------content/myjs.js
    ------nain.qml
    ------pages.qml
    ------splash.qml

    and the images are in the folder content/imgs/pages/*.jpg

    Thank you.

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

      Hi and welcome to devnet,

      You can use the assets for Android. See here

      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
      1
      • Z Offline
        Z Offline
        Zakaria
        wrote on last edited by
        #3

        Thank you, you saved my life :)

        i added the images file under

        Android/assets/images

        Image {
        id: page1
        source: "assets:/images/1.jpg"
        }
        

        it works fine and the apk size is about 80Mb so that mean all the images are in the APK

        Thanks again :)

        Zakaria

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

          You're welcome !

          Happy coding :)

          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

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved