Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Using vendor-supplied JAR file with Necessitas

    Language Bindings
    1
    1
    811
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      PhilipM2 last edited by

      Hi,
      I'm writing an application with Necessitas in Qt Creator, and need to use a vendor-supplied Jar file in order to access the serial port of the Android device. However, I'm not sure how to include the Jar file in the project so that I can use it, because when I use the following code:

      @JavaVM* currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0);
      

      currVM->GetEnv( (void**)&env, JNI_VERSION_1_6);
      jclass cls = 0;
      cls = env->FindClass("com/vendor/SerialPort");
      env->ExceptionDescribe();@

      To try and get a reference to the appropriate Java class, it fails to do so, giving this message from ExceptionDescribe() : W/System.err( 2116): java.lang.NoClassDefFoundError: [generic] at dalvik.system.NativeStart.main(Native Method)

      If I try any other Java or Android class, it works correctly, so obviously I need to do something else to make the JAR available to my project when using Qt Creator - Does anybody know what? There’s plenty of information on how to do this with Eclipse, but I haven’t been able to make this work with Qt Creator at all.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post