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. Call C++ slot from Java
Forum Updated to NodeBB v4.3 + New Features

Call C++ slot from Java

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 2.5k 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.
  • FerniF Offline
    FerniF Offline
    Ferni
    wrote on last edited by
    #1

    Hi everyone!
    I was working with my Android application and I trying to get NMEA messages from GPS.
    Up to now:

    1. I wrote java code to implement an NmeaListener and call a native function every time that a message is received.
    2. I wrote an Android GPS class (just in case that I want to integrate more GPS sources) that define my native function.
    3. What is still missing is that I want to emit a signal or call a slot from this class but I cannot understand how should I do that. I found here a post from stackoverflow that is trying to do the same thing but I get a compile error
      cannot call member function 'GpsAndroid GpsAndroid::instance()' without object*

    Could you help me with this? Is there an easy way to call a slot or emit a signal from Java?

    Thanks!!
    Fernando

    1 Reply Last reply
    0
    • FerniF Offline
      FerniF Offline
      Ferni
      wrote on last edited by
      #2

      I found this repo that has helped me a lot. I could make what I wanted to do!

      1 Reply Last reply
      2
      • O Offline
        O Offline
        Orbital
        wrote on last edited by
        #3

        Using static C++ methods with the JNI registration interface works better for me: https://ambes-engineering.com/2018/03/22/qt-java-native-interface/

        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