In java, i write a library, something like this:
Then in B4A, I write event something like this :
The B4A event is called on Debug and Release Mode.
returndata in java, only sucess (have value) in Release mode, using raiseEvent and raiseEvent2, but not on raiseEventFromDifferentThread (null)
On debug mode, returndata in Java always null.
Any suggestion ?
Java code:
_client.on(eventname, new Emitter.Listener() {
@Override
public void call(Object... args) {
// some codes
if (debugmode) raise_log("Event "+eventname+" value is Object, raising with Object");
// first try using raiseEvent
//returndata = bax.raiseEvent(Me, eventtoraise, new Object[] {valuedata});
// second try using raiseEvent2
//returndata = bax.raiseEvent2(Me, false, eventtoraise, false, new Object[] {valuedata});
// third try using raiseEventFromDifferentThread
returndata = bax.raiseEventFromDifferentThread(Me, null, 0, eventtoraise, false, new Object[] {valuedata});
if (debugmode) raise_log("Return Data = "+returndata);
}
}
Then in B4A, I write event something like this :
B4A Code:
Private Sub socket_app_version(value As String) As String
Log("value = "&value)
Dim reply As String = "Version Different"
Return reply
End Sub
The B4A event is called on Debug and Release Mode.
returndata in java, only sucess (have value) in Release mode, using raiseEvent and raiseEvent2, but not on raiseEventFromDifferentThread (null)
On debug mode, returndata in Java always null.
Any suggestion ?