正確にそれを行う方法がわかりません。ただし、Receiver for SMSを使用するのと同じ方法で、ReceiverforBluetoothを使用できます。
受信者の登録(マニフェストまたはコード内)
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/