[solved] Using native Android APIs from Qt
-
I am considering using Qt for my next Android project. This project will involve a lot of work with hardware device functions, e.g. I'll need direct access to Wi-Fi adapter (http://developer.android.com/reference/android/net/wifi/package-summary.html)
Is it possible to use native Android API functions in Qt project even if they're not wrapped in Qt framework? Is it possible to call native Android code from Qt C++?
I mean, is it true that everything that I could do with native Android tools (Java or JNI) I can do with Qt?
Where do I learn about this? -
Hi,
You can call Android native API through e.g. QAndroidJniObject. The QtAndroidExtras module is the one you will be interested in.
Hope it helps
-
Thanks, I will look at it!
The most important thing I am concerned about is this question:
is it true that everything that I could do with native Android tools (Java or JNI) I can do with Qt? -
There's no 1 to 1 wrapping of absolutely all functionalities provided by Android. That's why there's the module I indicated. However if you encounter a use case where you need to write some Java code, you can use it in your Qt application. Take for example "this":http://doc.qt.io/qt-5/qtandroidextras-notification-example.html
-
[quote author="SGaist" date="1422834149"]There's no 1 to 1 wrapping of absolutely all functionalities provided by Android. That's why there's the module I indicated. However if you encounter a use case where you need to write some Java code, you can use it in your Qt application. Take for example "this":http://doc.qt.io/qt-5/qtandroidextras-notification-example.html[/quote]
Ok, got it :)
So if there's a case where I need to use something really custom, I just code it in Java and plug into my Qt app. This should work, thanks! -
Exactly !
You're welcome !
If your question is answered, please update the thread title prepending [solved] so other forum users may know that's all good :)