Library in Qt used in an Android App ( Java )
-
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 ?
-
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. -
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.