PDA

View Full Version : Do I need JNI for my C++ library when deploying to Android?



ColGeorgeTaylor
22nd May 2015, 19:07
On Linux(Ubuntu) my Qt Creator(5.4.1) application links in my own C++ external library (.so file) and runs with no problems.

Now, when I want to switch kits to Android and deploy it to Android, then I would need to recompile my .so library file for Android architecture. My question is, do I need to create a JNI wrapper for my external library for it to be used with my Qt Creator application on Android?

Also, forget about my library for a moment, to help me understand it better, under the covers, is Qt using JNI to call its libraries?

Previously, I was using Eclipse with ADT to create a library for Android, but now that is deprecated and the preferred way is to use Android Studio to create a library for Android. Is this the general consensus?

Thanks

anda_skoa
23rd May 2015, 14:11
Now, when I want to switch kits to Android and deploy it to Android, then I would need to recompile my .so library file for Android architecture. My question is, do I need to create a JNI wrapper for my external library for it to be used with my Qt Creator application on Android?

I would think this depends in the language the application is using. If the application is using C++ then it can obviously direclty link against any C++ library.
If the application is being written in Java, it will need some bridge code to link to the library.



Also, forget about my library for a moment, to help me understand it better, under the covers, is Qt using JNI to call its libraries?

Not sure what you mean, Qt is "the libraries".

Cheers,
_