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. Android: how to use local libraries
QtWS25 Last Chance

Android: how to use local libraries

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
androidc++librarypath
10 Posts 4 Posters 1.3k 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.
  • KroMignonK Offline
    KroMignonK Offline
    KroMignon
    wrote on last edited by
    #1

    Hi all,

    maybe a seely question, but I want to know if it is possible to use a locally available C++ library with Qt for Android?

    I've got some huge libraries which are stored somewhere in the internal storage of my Android device (/sdcard/myLibs/).
    I don't want to add those libraries in the APK, is it possible to define a kind of "extra libraries path"?

    Thanks for any suggestion

    Fabrice

    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

    jsulmJ T 2 Replies Last reply
    0
    • KroMignonK KroMignon

      Hi all,

      maybe a seely question, but I want to know if it is possible to use a locally available C++ library with Qt for Android?

      I've got some huge libraries which are stored somewhere in the internal storage of my Android device (/sdcard/myLibs/).
      I don't want to add those libraries in the APK, is it possible to define a kind of "extra libraries path"?

      Thanks for any suggestion

      Fabrice

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @KroMignon said in Android: how to use local libraries:

      I don't want to add those libraries in the APK

      Why not? If your app is linked against these libs your APK will not work without them.
      Or do you load these libs dynamically at runtime?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      KroMignonK 1 Reply Last reply
      1
      • jsulmJ jsulm

        @KroMignon said in Android: how to use local libraries:

        I don't want to add those libraries in the APK

        Why not? If your app is linked against these libs your APK will not work without them.
        Or do you load these libs dynamically at runtime?

        KroMignonK Offline
        KroMignonK Offline
        KroMignon
        wrote on last edited by
        #3

        @jsulm said in Android: how to use local libraries:

        Why not?

        Because I want to reduce APK size. Do I need to have all libs I use in the APK, is there no way to have "shared libraries" between APKs?

        It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

        jsulmJ 1 Reply Last reply
        0
        • KroMignonK KroMignon

          @jsulm said in Android: how to use local libraries:

          Why not?

          Because I want to reduce APK size. Do I need to have all libs I use in the APK, is there no way to have "shared libraries" between APKs?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @KroMignon The problem I see: APK will not work without these libs, so how are you going to distribute your apps? I'm not an expert but I'm quite sure this is not supported by Android because of security: apps can only execute what is part of APK and nothing else (sandbox).

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          KroMignonK 1 Reply Last reply
          0
          • jsulmJ jsulm

            @KroMignon The problem I see: APK will not work without these libs, so how are you going to distribute your apps? I'm not an expert but I'm quite sure this is not supported by Android because of security: apps can only execute what is part of APK and nothing else (sandbox).

            KroMignonK Offline
            KroMignonK Offline
            KroMignon
            wrote on last edited by
            #5

            @jsulm It is a fully custom application, for customize hardware. It not has to be distributed to "the world" or to any app store. My goal is to be able to reduce APK size for on-line updates

            It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

            jsulmJ 1 Reply Last reply
            0
            • KroMignonK KroMignon

              @jsulm It is a fully custom application, for customize hardware. It not has to be distributed to "the world" or to any app store. My goal is to be able to reduce APK size for on-line updates

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @KroMignon OK, understand.
              I'm not sure this is possible with not rooted devices because of sandboxing, but I'm not expert.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • KroMignonK KroMignon

                Hi all,

                maybe a seely question, but I want to know if it is possible to use a locally available C++ library with Qt for Android?

                I've got some huge libraries which are stored somewhere in the internal storage of my Android device (/sdcard/myLibs/).
                I don't want to add those libraries in the APK, is it possible to define a kind of "extra libraries path"?

                Thanks for any suggestion

                Fabrice

                T Offline
                T Offline
                Tom_H
                wrote on last edited by
                #7

                @KroMignon You should be able to do it the same way that Ministro does it. The libraries have to be in a readable location. I think Ministro puts the Qt libraries in /data/local/tmp/qt, but anywhere under /data should work. Then you would have to dynamically load them. I don't think /sdcard/myLibs would work.

                SGaistS 1 Reply Last reply
                0
                • T Tom_H

                  @KroMignon You should be able to do it the same way that Ministro does it. The libraries have to be in a readable location. I think Ministro puts the Qt libraries in /data/local/tmp/qt, but anywhere under /data should work. Then you would have to dynamically load them. I don't think /sdcard/myLibs would work.

                  SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Tom_H said in Android: how to use local libraries:

                  @KroMignon You should be able to do it the same way that Ministro does it. The libraries have to be in a readable location. I think Ministro puts the Qt libraries in /data/local/tmp/qt, but anywhere under /data should work. Then you would have to dynamically load them. I don't think /sdcard/myLibs would work.

                  The problem is that recent version of Android disabled the access to such shared folder so it can't be used anymore.

                  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
                  • KroMignonK Offline
                    KroMignonK Offline
                    KroMignon
                    wrote on last edited by
                    #9

                    @Tom_H @SGaist , thanks a lot for your suggestions.
                    In fact, the hardware I am targeting is rooted. I could copy Qt files anywhere but I don't really know what is the right way to do it.
                    It is based on Android 7.0 (Nougat).

                    Perhaps is using/customizing Ministro the best way?

                    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                    jsulmJ 1 Reply Last reply
                    0
                    • KroMignonK KroMignon

                      @Tom_H @SGaist , thanks a lot for your suggestions.
                      In fact, the hardware I am targeting is rooted. I could copy Qt files anywhere but I don't really know what is the right way to do it.
                      It is based on Android 7.0 (Nougat).

                      Perhaps is using/customizing Ministro the best way?

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @kromignon Since Android is based on Linux you could put the libs in /usr/lib and see whether it works.

                      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