I have extended CordovaActivity
, and implemented WLInitWebFrameworkListener
plus BluetoothAdapter.LeScanCallback
in native code
public class MainActivity extends CordovaActivity implements WLInitWebFrameworkListener, BluetoothAdapter.LeScanCallback{
Inside this class I have implemented
@Override public void onInitWebFrameworkComplete(WLInitWebFrameworkResult arg0) { // if a device is connected launch application if(mConnectedGATT.connect()){ WL.getInstance().addActionReceiver(new ErosReceiver()); super.loadUrl(WL.getInstance().getMainHtmlFilePath()); } else{Log.i(TAG, "Could not connect");} }
I have added the following to main.js in a function
WL.App.SendActionToNative ("ReqSlaveList", data);
I have created another class
MyReceiver
public class MyReceiver implements WLActionReceiver {
Implemented
public void onActionReceived(String action, JSONObject data)
Now it seems like the OnActionReceived
never gets called.