Liuliumoto
Liuliumoto
  • 发布:2015-05-11 20:50
  • 更新:2015-07-17 15:29
  • 阅读:3491

Android中BroadcastReceiver 广播使用Native.js如何开发

分类:Native.js

想用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,插件?

恳请各位大牛解答,非常感谢!

2015-05-11 20:50 负责人:无 分享
已邀请:
Jayming1024

Jayming1024

http://ask.dcloud.net.cn/question/7661
下面有蓝牙监听的例子

该问题目前已经被锁定, 无法添加新回复