[Interest] Qt on Android needs improvements
Jason H
jhihn at gmx.com
Thu Aug 18 21:53:37 CEST 2016
The more I do on Android the more I realize the situation is less than ideal.
My issues are thus:
1. I need to call native (Qt) code in MyActivity.onCreate(), but there is no notification that Qt is ready. In fact Qt doesn't finish loading until after onCreate. I need some kind of blocking call or callback or onQtComplete handler to be able to know that I can interact with native code.
2. I need to be able to call native code before Qt even starts. I have some non-GUI classes which interact with a SQLite database. I cannot figure out how to make this available, even though it should be fine. The C main() doesn't get called until Activity.onCreate(). It's be better to call the main() on the Application.onCreate(), then have another C/C++-function for the rest of the GUI. This way main objects initialized in the main() will exist and be properly initialized.
3. I need a way to access the QML Offline storage database from Android. I have found that if I use the Android API to access the SQLite file at the the same time Qt is using it, it will corrupt (too often) the database.
I don't know how to do the above*. If anyone knows, I would appreciate it.
*I have a hack for #1, where I the C++ code calls into JNI to set a static variable, and I run additional code, but it's not reusable or flexible as it should be.
More information about the Interest
mailing list