Results 1 to 2 of 2

Thread: Do I need JNI for my C++ library when deploying to Android?

  1. #1
    Join Date
    May 2015
    Posts
    2
    Platforms
    Unix/X11 Windows Android

    Default Do I need JNI for my C++ library when deploying to Android?

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Do I need JNI for my C++ library when deploying to Android?

    Quote Originally Posted by ColGeorgeTaylor View Post
    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.

    Quote Originally Posted by ColGeorgeTaylor View Post
    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,
    _

Similar Threads

  1. Replies: 2
    Last Post: 21st August 2014, 20:36
  2. QtQML and a C library on Android.
    By Scorp2us in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 11th February 2014, 12:43
  3. Deploying desktop application on android
    By Baso in forum Installation and Deployment
    Replies: 0
    Last Post: 3rd December 2013, 19:08
  4. Deploying an app with additional library
    By kornicameister in forum Qt Programming
    Replies: 8
    Last Post: 10th July 2011, 16:51
  5. Problem deploying a two library + executable application to windows
    By joseprl89 in forum Installation and Deployment
    Replies: 8
    Last Post: 15th March 2011, 21:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.