JNI via QML: Async or Sync
-
@
Component.onCompleted: {
whatever = MyJni.getName();
nextline();
}@Let say the getName method return a string, Will it wait for the java and c++ method to return before executing nextline() ?
Thanks !
-
yes is the short answer, nextline() will only be executed after MyJni.getName() returns.
How is MyJni.getName() implemented? Does it spin an event loop while waiting for a result? If so, that could be problematic.
-
Nah my idea was to connect to the google play services through a JNI call, but apparently the gps connection is async and the method doesnt return anything to let me know when its done.. I need to know when its done to show my next screen only at this moment, I might have to go the other way around and call C++ from Java when the gps connection is completed..
Thanks!