PDA

View Full Version : How do I add Java code to Qt Android apps via Qt Creator



scottwild
25th September 2013, 18:41
Greetings.

I have a Qt 5.1.1 app running on Android that needs to manage Bluetooth connections. It appears that I’ll need to write a custom Java Bluetooth management class that I can then use JNI to communicate with.

My question is: How do I add the Java code to my Qt Creator (v2.8.1) project so that it gets built into my app?

Thank you

wysota
25th September 2013, 20:52
I don't think you can do that. Qt apps are C++ apps with some static launcher code written in Java.

ChrisW67
26th September 2013, 03:22
Is the external Qt Bluetooth module useful? http://qt-project.org/wiki/Qt-Add-ons-Modules

scottwild
1st October 2013, 23:09
Hi Chris

Thanks for the info, but it looks like the code you pointed me to relies on the bluez linux bluetooth driver layer which, according to what I've read, is not guaranteed to be available on all android target devices. Since the Java layer (allegedly) provides me with that guarantee, I would like to use it if at all possible.

Thank you
Scott