想用NJS开发蓝牙通信,在蓝牙通信中使用了BroadcastReceiver 广播,但是不知道NJS是如何建立起这个广播的,比如以下代码
private BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
System.out.println(device.getName());
}
}
}
使用NJS该如何翻译?或者可以使用其他的方式开发蓝牙,h5+SDK,插件?
恳请各位大牛解答,非常感谢!
1 个回复
Jayming1024
http://ask.dcloud.net.cn/question/7661
下面有蓝牙监听的例子