我不知道该怎么做。但是,就像您使用 Receiver for SMS 一样,您也可以使用 Receiver for Bluetooth。
注册接收者(清单或代码中)
registerReceiver(ActionFoundReceiver, new IntentFilter(
BluetoothDevice.ACTION_FOUND));
并定义接收者
private final BroadcastReceiver ActionFoundReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
String action = intent.getAction();
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
BluetoothDevice device = intent
.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
String name;
name = device.getName();
}
}
};
我想:通过交流,您可以捕捉到另一个给您文本的意图的婴儿车。
如果你想要一些例子看看。
http://android-er.blogspot.com.es/2011/05/scan-bluetooth-devices.html 和
http://luugiathuy.com/2011/02/android-java-bluetooth/