android


Qt on Android studio


Using Qt creator, I complied MyLib.so, MyLibQt.so (compiled for android). MyLib is wrapper for using MyLibQt. In MyLibQt I have such lines
if (!QApplication::instance())
{
g_bCleanUpInstance = true;
new QApplication(argc, argv);
}
At Android Studio I added these libs to project (jniLibs). The lib has been successfully added to apk, it has been compiled.
The problem is: when I try call method from MyLib, using previous lines of code, I get exception:
A/MyLibQt.dll: (null):0 ((null)): This application failed to start because it could not find or load the Qt platform plugin "android"
I added to jniLibs libqtforandroid.so, but it didn't helped. So, my question is: how to resolve it?
As it is obvious from the error message, a Qt application is not just some code you can run willi-nilly, it runs against its own "runtime" that is the platform plugin, which provides the link between the Qt code and the device.
The platform plugin will be bundled with the Qt application when you are using the Qt toolchain, and in the case of android Qt apps, the Qt code is compiled as a .so library anyway. But you are explicitly compiling it as a library, so the platform plugin is not included, because it is assumed you will be using that library in a Qt application which will include it.
It may be possible to do it manually, but I am not an expert on that subject, there might be other complications, such as not running on an activity tailored to support a Qt application, or some other auxiliary files needed by Qt which would typically be created and bundled by the Qt toolchain, but it is a safe bet to do the opposite thing - just build your Qt application with the Qt toolchain, and use the necessary Java code from it.

Related Links

Android: Parse error when parsing manifest. Discontinuing installation
Text in Button Changing on clicking other controls
Android Progress Dialog not showing until the function finish running (AsyncTask)
Android String.split() and/or StringTokenizer() not working in While loop
Android spreadsheat-like application scrolling
Make a dynamic launcher icon
Return to first Dialog Window with Back-Button
Possible to use two ArrayLists to populate one spinner with custom layout?
RelativeLayout as customise thumb in SeekBar android
ClickableSpan strange behavior:onClick() called when clicking empty space
Object as a source for the listview
Android: one handler for all runnables?
Android actionbar sherlok doesn't show divider
How to use another layout id?
How to stop or destroy a running Thread
how to create a build file to build mono android project and generate myproject.apk file.?

Categories

HOME
jpa
github-for-windows
phpmyadmin
nunit
ns-3
bitbucket-api
interpolation
jetty
gkturnbasedmatch
magnetic-cards
parameter-passing
http-post
azure-powershell
linear-algebra
chargify
wolframalpha
boost-icl
selinux
drive
blade
pagespeed
qliksense
draft-js-plugins
custom-post-type
motion-detection
jasmine-node
progress-bar
genexus-sd
handler
bringtofront
browser-sync
gp
vex
livelink
left-join
glib
memory-address
mailkit
getpixel
python-pptx
lint
watchman
jpad
google-earth-engine
cd
projects-and-solutions
google-data-api
plaintext
laravel-elixir
lpsolve
x++
servermanager
mesosphere
getchar
libgphoto2
gitlist
globalize
vugen
git-flow
oozie-coordinator
pocketsphinx-android
polyline
cubism.js
hadoop-2.7.2
winusb
udpclient
boost-serialization
jparsec
concept-insights
ascii-art
vhosts
gocql
avisynth
flock
morton-number
ons-api
fuelcms
opserver
shopizer
xmltype
qtwebengine
apache-spark-1.3
cuba
dot42
vsx
extjs2
dsym
android-audiorecord
code-duplication
css-reset
fb.ui
booksleeve
tree-balancing
zope.interface
cuda-gdb
extconf.rb
multiplexing
oracle-enterprise-linux
wiimote
agility.js
workflow-services
mysql-error-1205
webdev.webserver
http-daemon
svk
metaweblog
appliance

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App