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. Library in Qt used in an Android App ( Java )
Forum Updated to NodeBB v4.3 + New Features

Library in Qt used in an Android App ( Java )

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 2 Posters 3.3k 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.
  • M Offline
    M Offline
    MaxL
    wrote on 13 Nov 2013, 10:52 last edited by
    #1

    Hi everyone,

    I am facing an issue with using qt 5.2 mixed up with a Java App for Android.

    Here is the situation :

    • Simple application (hello world-like) built in eclipse.
    • A library based on Qt built with cmake as a shared library.

    When starting the application, it crashes and says that it could not load library "libQt5Network.so" need by "libJNI.so", caused by library 'libQt5Network.so".

    For various reason, i would like to still develop the application in java but would like to integrate some features of Qt. I know that when building an application only with Qt, there is that possibility to embed Qt libraries or use ministro. How could I do so, through eclipse ?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MontezooM
      wrote on 14 Nov 2013, 09:24 last edited by
      #2

      Hi,
      In fact, each Qt application for android consists of two parts:
      actually qt code and "Java bindings". More info you could find "here":http://blog.qt.digia.com/blog/2013/07/23/anatomy-of-a-qt-5-for-android-application/. If you want to mix qt application with java code, you could inherit QtActivity class (which is used to launch qt application on Android, load library, invoke Ministro etc.) and write there your java code.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MontezooM
        wrote on 14 Nov 2013, 09:35 last edited by
        #3

        Also you could try use Qt's Java binding as an example and write your own main Activity, that will load all necessary library, forward event to qt and so on.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MaxL
          wrote on 14 Nov 2013, 18:51 last edited by
          #4

          Thanks for you answer, so does it means that I could have only libraries built in QT ( no UI ) and have the UI only in Java ?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MontezooM
            wrote on 14 Nov 2013, 21:07 last edited by
            #5

            Yes, but unfortunately I couldn't tell you how much effort it's needed. It seems to me that it can be not a trivial task and it depends of what Qt module your lib requires. Maybe you need only put and load some additional library like Qt5Network, or maybe your library need to have some launched QEventLoop to work so you need to have some wrapper for your library that launch QApplication. Anyway, source code of QtApplication.java and QtActivity.java could help you.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MaxL
              wrote on 15 Nov 2013, 08:18 last edited by
              #6

              I will look into that, I also looked at Qt Jambi which as wrapper for Qt in Java.

              1 Reply Last reply
              0

              1/6

              13 Nov 2013, 10:52

              • 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