How to check Device Near By Your Phone having Bluetooth?
final BluetoothDevice device = bluetooth.getRemoteDevice("01:23:77:35:2F:AA");
final Set<BluetoothDevice> bondedDevices = bluetooth.getBondedDevices();
BroadcastReceiver discoveryResult = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
BluetoothDevice remoteDevice =
intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
if ((remoteDevice.equals(device) &&
(bondedDevices.contains(remoteDevice)) {
// TODO Target device is paired and discoverable
}
};
registerReceiver(discoveryResult, new IntentFilter(BluetoothDevice.ACTION_FOUND));
if (!bluetooth.isDiscovering())
bluetooth.startDiscovery();
hello could you please explain a bit more this is that I try to do this and shows me errors and I really need to learn how to scan for other bluetooth please: (it connects to a draft plus a band WearLink heart rate monitor bluetooth to make a
ReplyDelete