윤영두
윤영두

Reputation: 11

How long bluetoothLeScanner scan time?

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

Answers (1)

Lokesh Mehta
Lokesh Mehta

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

Related Questions