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 Java/Kotlin with CMake Qt 6. How?
Forum Updated to NodeBB v4.3 + New Features

Using Java/Kotlin with CMake Qt 6. How?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 2 Posters 482 Views
  • 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
    bogong
    wrote on last edited by
    #1

    Hello all!

    Trying to find examples or manuals or references for the case of mixing Java/Kotlin in Qt 6 project with CMake. Is there any? Is it possible to use Kotlin instead of Java with Qt 6?

    JonBJ 1 Reply Last reply
    0
    • B Offline
      B Offline
      bogong
      wrote last edited by bogong
      #5

      Solution found. Example published. It works for Java code. For using Kotlin haven't found any solution.

      1 Reply Last reply
      0
      • B bogong

        Hello all!

        Trying to find examples or manuals or references for the case of mixing Java/Kotlin in Qt 6 project with CMake. Is there any? Is it possible to use Kotlin instead of Java with Qt 6?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #2

        @bogong
        I know nothing about Java or Kotlin. However there is a QtJambi project which provides Java/Kotlin bindings for Qt, would looking at its sources or perhaps contacting its author help you here? The author posts regularly on this forum as each QtJambi version is released for each Qt release. Last post was: https://forum.qt.io/topic/163086/qtjambi-6.9.2-available

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bogong
          wrote on last edited by bogong
          #3

          Found this manual for using Java https://somcosoftware.com/en/blog/how-to-interface-qt-with-android-java-code-2023. Didn't tested it yet by my own.

          Going to write my own example based on this manual. Will publish here link on it.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bogong
            wrote last edited by
            #4

            Official documentation https://doc.qt.io/qt-6/deployment-android.html

            Briefly - you need to define QT_ANDROID_PACKAGE_SOURCE_DIR variable correctly, something like this in CMakeLists.txt:

            if(ANDROID)
            set_property(TARGET ${A_NAME_APPLICATION} PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR "/full/path/to/Platforms/android")
            endif()
            

            In which you need to create 'src' folder

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bogong
              wrote last edited by bogong
              #5

              Solution found. Example published. It works for Java code. For using Kotlin haven't found any solution.

              1 Reply Last reply
              0
              • B bogong has marked this topic as solved

              • Login

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