Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Using Qt within an Android Native.Activity project in Visual Studio 2015 / 2017
Forum Updated to NodeBB v4.3 + New Features

Using Qt within an Android Native.Activity project in Visual Studio 2015 / 2017

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 Posters 1.6k Views 2 Watching
  • 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.
  • B Offline
    B Offline
    bralecou
    wrote on last edited by bralecou
    #1

    How do I use Qt in an Android NativeActivity project in Visual Studio 2015 or 2017.

    I am having link issues.

    I am trying code like below. But obviously, there must be a cleaner approach.

    Any one has an example? and can describe steps for integrating Qt into android_main(struct android_app* state)

    Please help show how to integrate Qt into

    /**
    * This is the main entry point of a native application that is using
    * android_native_app_glue. It runs in its own thread, with its own
    * event loop for receiving input events and doing other things.
    */
    
    void android_main(struct android_app* state) {
    
    int argc = 0;
    char* argv[] = {};
    QApplication a(argc, argv);
    

    And also even when I comment out my code. And specify, for instance Qt5Location;Qt5Positioning; in Library dependencies,
    the application crash in the emulator even before ANativeActivity_onCreate is called. I suspect the Qt shared libraries are not being copied over and loaded on the emulator or device.

    Please help elucidate.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That's a question you should bring to the Qt Android mailing list. You'll find there Qt's Android port developers/maintainers. This forum is more user oriented.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        That's a question you should bring to the Qt Android mailing list. You'll find there Qt's Android port developers/maintainers. This forum is more user oriented.

        B Offline
        B Offline
        bralecou
        wrote on last edited by bralecou
        #3

        @SGaist
        Thanks SGaist. I ll check that mailing list as well

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          The usual approach to JNI and Qt is to store the Java classes in android dir, and not to use android_main. Rather, Qt is responsible for bootstrapping the Android app, creating the event loop etc. and only then Java is accessed by JNI.

          This is somewhat explained here http://doc.qt.io/qt-5/qandroidjniobject.html and also in a splendid series of posts by BogDan (the creator of Qt on Android): https://www.kdab.com/author/bogdan-vatra/

          (Z(:^

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved