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. How to ship files on Android with Necessitas
Qt 6.11 is out! See what's new in the release blog

How to ship files on Android with Necessitas

Scheduled Pinned Locked Moved Mobile and Embedded
10 Posts 3 Posters 7.1k 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.
  • S Offline
    S Offline
    Seba84
    wrote on last edited by
    #1

    Hello everyone,

    I am developping an app for Android using Necessitas that interfaces with a sqlite database. The problem is that this database already exists, and I need to ship it with the app. Do you know how to do this?

    I think this problem is not database related but more generally to all files.

    Thanks,
    Seba84

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Add it to qmake's DEPLOYMENTOLDERS or DEPLOYMENT ("link":http://qt-project.org/forums/viewthread/2556). You can also search on Necessitas forum, I remember there was a similar topic a few months ago ("link":https://groups.google.com/forum/#!forum/android-qt).

      You can also use QRC, but that would give you a read-only DB, which is not nice :)

      (Z(:^

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Seba84
        wrote on last edited by
        #3

        Thanks sierdzio for the quick answer!

        I tried to do the DEPLOYMENT method in your link and didn't worked, I must be doing something wrong. After investigating a bit the method in the net, here it is another solution that didn't work neither:

        @
        deployment.files = stock.dba
        deployment.path = /data/data/org.kde.necessitas.example.test/files

        INSTALLS += deployment
        @

        Taken from this "link":http://techbase.kde.org/Development/Tutorials/Necessitas.

        Anyway I managed to upload the database file through my mail box (I send myself an email and downloaded the attachment in the tablet), then I found where it was stored (thanks to QFileDialog) and that was solved. For the time being I don't in how many tablets I will need to install the software, but it is clear that I cannot do this each time.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Well yes, that's clearly suboptimal :) Unfortunately I can't help you more - for my use cases, QRC is enough and that is all I've used to date (on droid, that is). I think it's possible to use some native Android tools to do that. If it's not on official forum, try searching on mailing list. I'm sure I've seen it somewhere.

          (Z(:^

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            Ah, there it is! Turned out it was in my bookmarks :P Here you go, hope that helps: "LINK":http://techbase.kde.org/Development/Tutorials/Necessitas.

            (Z(:^

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Seba84
              wrote on last edited by
              #6

              By the way, when trying to open the db, I found the QSQLITE driver not loaded error. This was simply solved by adding the following line in the main() function:
              @ a.addLibraryPath("/data/data/org.kde.necessitas.ministro/files/qt/plugins"); @

              just after the QApplication declaration.

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                That's a nice trick, thanks for sharing. Be sure to check out my last post, you might have missed it cause we posted almost simultaneously.

                (Z(:^

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Seba84
                  wrote on last edited by
                  #8

                  Yes, we posted simultaneously.

                  You can see I used the same link for the code before. But I couldn't make it work. And I don't see in the compilation, deployment and execution phases anything saying that the files are being copied.

                  I used QFileDialog to explore the tablets storage media but I couldn't find the file (expect for the one I downloaded from my mailbox).

                  1 Reply Last reply
                  0
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #9

                    Sad. Regrettably, I have nothing more to add, then, apart from suggestion to ask on Necessitas forum and/ or mailing list.

                    (Z(:^

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mbnoimi
                      wrote on last edited by
                      #10

                      [quote author="Seba84" date="1335785134"]Yes, we posted simultaneously.

                      You can see I used the same link for the code before. But I couldn't make it work. And I don't see in the compilation, deployment and execution phases anything saying that the files are being copied.

                      I used QFileDialog to explore the tablets storage media but I couldn't find the file (expect for the one I downloaded from my mailbox).[/quote]

                      Did you find a solution for this issue? I'm suffering from it right now and I digget it deep into Necessitas mailing list and got nothing!

                      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