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 908 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 7 Feb 2018, 19:48 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
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 7 Feb 2018, 20:04 last edited by sierdzio 2 Jul 2018, 20:12
      #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 7 Feb 2018, 20:15
      3
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 7 Feb 2018, 20:08 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
        • S sierdzio
          7 Feb 2018, 20:04

          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 7 Feb 2018, 20:15 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 7 Feb 2018, 20:43
          1
          • R refaQtor
            7 Feb 2018, 20:15

            @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 7 Feb 2018, 20:43 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
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 8 Feb 2018, 06:07 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

              1/6

              7 Feb 2018, 19:48

              • Login

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