This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to scan only Advertising Packet BLE [ANDROID]

While scanning for advertising beacons with startLeScan method, this method also request peripheral device for scan response and stores it in scanRecord. I only want to scan for advertising payload I don’t want to send request scan response to peripheral device

my code to scan:

mBluetoothAdapter.startLeScan(mLEScanCallback);
private BluetoothAdapter.LeScanCallback mLEScanCallback = new BluetoothAdapter.LeScanCallback() {
    @Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {

}
};
Related