I need to return a value from JSNI GWT method like so:
public native int connect(String macAdress) /*-{
var result = 0;
$wnd.bluetoothSerial.connect(macAdress, function() {
$wnd.console.log("connect success");
result = 1 ;
}, function() {
$wnd.console.log("Failed connect");
});
return result;
}-*/;
form some reasons it return 0 even if the connection successful. Apparently this variable keep the default value, Any ideas?