Reputation: 11
I changed code
BluetoothAdapter.startLeScan
to
BluetoothLeScanner.startScan(callback)
So, Scanning performance up enough my think, but I don't know bluetoothLeScanner scan time.
BluetoothAdapter.startLeScan
has changing scan time.
please, answer.
Upvotes: 0
Views: 3972
Reputation: 631
You need to stop Scan using handler .Use this code to stop scan After 10 second
BluetoothLeScanner.startScan(callback);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
BluetoothLeScanner.stopScan(callback);
}
}, 10000);
Upvotes: 6