start bluetooth Scanning - Android Bluetooth

Android examples for Bluetooth:Turn On bluetooth

Description

start bluetooth Scanning

Demo Code


//package com.java2s;

import android.bluetooth.le.BluetoothLeScanner;
import android.bluetooth.le.ScanCallback;

import android.bluetooth.le.ScanSettings;

public class Main {
    public static void startScanning(BluetoothLeScanner scanner,
            ScanCallback callback) {//from  w ww.  j av  a  2 s  . c o m
        ScanSettings settings = new ScanSettings.Builder().setScanMode(
                ScanSettings.SCAN_MODE_BALANCED).build();
        scanner.startScan(null, settings, callback);
    }
}

Related Tutorials