Solved Call C++ slot from Java
-
Hi everyone!
I was working with my Android application and I trying to get NMEA messages from GPS.
Up to now:- I wrote java code to implement an NmeaListener and call a native function every time that a message is received.
- I wrote an Android GPS class (just in case that I want to integrate more GPS sources) that define my native function.
- 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 -
I found this repo that has helped me a lot. I could make what I wanted to do!
-
Using static C++ methods with the JNI registration interface works better for me: https://ambes-engineering.com/2018/03/22/qt-java-native-interface/