[Interest] Native library for Android using Qt

jhihn at gmx.com jhihn at gmx.com
Tue Nov 24 13:55:01 CET 2015


I think you may be going about this the wrong way.  JNI is for getting to android or providing to Android.  If you want to use a native library with Qt,  then just use it.  

-----Original message-----
Sent: Monday, 23 November 2015 at 07:37:19
From: "Захаров Александр Владимирович" <zakharov_av at neurosoft.ru>
To: interest at qt-project.org
Subject: [Interest] Native library for Android using Qt
We are trying to develop a library using Qt components for use from a 
usual Java-based Android application. We have managed to write JNI code 
and call a function from the library. However, the library is using some 
GUI components (although it does not show anything on the screen) and at 
one point (specifically, when creating a QTextDocument object) it 
crashes with an exception in QFontLibrary code.

We have found that the library seems to require a valid QApplication 
object (when using QCoreApplication instead, it does not work). The 
library has one class implementing a singleton pattern with a single 
static method to be called from JNI. Is it possible to create a 
QApplication object in the class constructor? We tried to do it, but got 
and error:

This application failed to start because it could not find or load the 
Qt platform plugin "android".

Where should we place the plugins for the library and how to load them?

With best regards, Alexander
_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list