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. [CLOSED] is it possible to send notification from java to Qt?
Forum Updated to NodeBB v4.3 + New Features

[CLOSED] is it possible to send notification from java to Qt?

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 4 Posters 2.1k Views 1 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.
  • A Offline
    A Offline
    AlterX
    wrote on last edited by
    #1

    Hi,
    I have a java class as activity and I use some operation in that; I'd like to send a notification of a completed operation from within activity to Qt thru jni: is it that possible?

    Qt Ambassador
    Real-time cooperative teams: http://www.softairrealfight.net
    Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

    https://codereview.qt-project.org/...

    1 Reply Last reply
    0
    • McLionM Offline
      McLionM Offline
      McLion
      wrote on last edited by
      #2

      Are you looking for something like this:
      https://qt-project.org/doc/qt-4.7/qtwebkit-bridge.html

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AlterX
        wrote on last edited by
        #3

        Is this suitable for jni?!

        Qt Ambassador
        Real-time cooperative teams: http://www.softairrealfight.net
        Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

        https://codereview.qt-project.org/...

        1 Reply Last reply
        0
        • X Offline
          X Offline
          Xander84
          wrote on last edited by
          #4

          Hi, I guess that depends how do you want to send the message from java to c++?
          I don't know if there is an easy way, all I can think of is calling a native function from java through JNI, but you can't just access other apps in Android so you may have to use an intent or something. Then again I don't think you have android intents in the android NDK, for whatever reason :/

          Might be easier if you can create the activity from the Qt app and call the java function from there or something, Qt has some helper classes like "QAndroidJniObject":http://qt-project.org/doc/qt-5/qandroidjniobject.html and "QAndroidJniEnvironment":http://qt-project.org/doc/qt-5/qandroidjnienvironment.html you might want to take a look at those.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            ltr6
            wrote on last edited by
            #5

            You could probably send an intent from your activity to your Qt applications QtActivity. The Android docs will tell you how.

            To process the intent you can create a custom class that extends QtActivity. From that class you can then call native code. The QtHangman example does all that:

            http://blog.qt.digia.com/blog/2013/12/12/implementing-in-app-purchase-on-android/

            You can find a link to the sources in the post, too.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              AlterX
              wrote on last edited by
              #6

              I don't know...anyway I have given up with this solution.

              Thanks to all

              Qt Ambassador
              Real-time cooperative teams: http://www.softairrealfight.net
              Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

              https://codereview.qt-project.org/...

              1 Reply Last reply
              0

              • Login

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