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 deploy custom lib on Android (encrypted sqlite)

how to deploy custom lib on Android (encrypted sqlite)

Scheduled Pinned Locked Moved Solved Mobile and Embedded
6 Posts 3 Posters 897 Views
  • 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.
  • R Offline
    R Offline
    refaQtor
    wrote on last edited by
    #1

    I don't know where to put a custom lib, so that it will get wrapped up in the Android .apk, then get linked properly on the device.

    I've cross-compiled libsqlite.so with the Android NDK. And, as near as I can tell, Qt\5.9.x/android_armv7/plugins/sqldrivers/libqsqlite.so is expecting to link to the Android version on the device.

    I see some old advice ( https://groups.google.com/forum/#!topic/android-qt/k7sIjiFKO6E ) that suggests using addLibraryPath() which makes sense. But, I'm missing what path in the Qt code? Android code? to put my custom lib, and how to identify the library path to add on the device.

    Any tips?
    (incidentally, I'll have to bang on this for iOS, too)

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

      Use this in your .pro file:

      ANDROID_EXTRA_LIBS = /path/to/your/lib.so
      

      The path should be from your PC (so the build tool can find it and merge into the .apk).

      It is also possible to specify the library in Qt Creator's gui - see Project -> Build -> Build Android APK -> Additional libraries

      (Z(:^

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

        Hi,

        An alternative could to build your custom sqlite statically and then rebuild the Qt SQLite plugin against than one. This way you don't have to us an additional library.

        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
        2
        • sierdzioS sierdzio

          Use this in your .pro file:

          ANDROID_EXTRA_LIBS = /path/to/your/lib.so
          

          The path should be from your PC (so the build tool can find it and merge into the .apk).

          It is also possible to specify the library in Qt Creator's gui - see Project -> Build -> Build Android APK -> Additional libraries

          R Offline
          R Offline
          refaQtor
          wrote on last edited by
          #4

          @sierdzio Thanks! I'll give that a try.

          Will I then need to addLibraryPath() , or will it have been added automatically?

          R 1 Reply Last reply
          1
          • R refaQtor

            @sierdzio Thanks! I'll give that a try.

            Will I then need to addLibraryPath() , or will it have been added automatically?

            R Offline
            R Offline
            refaQtor
            wrote on last edited by
            #5

            @sierdzio Great! that seemed to do the trick! I can see the message linking on the Android console.

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

              Nice :) Happy further coding!

              ... and before you ask - I don't know how to do the same on iOS. I know that using LIBS works, but I guess that does not count for plugins.

              (Z(:^

              1 Reply Last reply
              1

              • Login

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