I'm developing an application with Bluetooth Low Energy using Nexus 5. It worked on Lollipop and now it is not working on Marshmallow. I set the ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permissions in the manifest and on runTime in the Activity.
This is the list of ScanFilters:
mScanFilterTest = new ScanFilter.Builder().build();
mScanFilter = new ArrayList<ScanFilter>();
mScanFilter.add(mScanFilterTest);
These are the settings:
mScanSettings = new ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_POWER).setReportDelay(0)
.setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES).build();
These are my callbacks:
mBLEScan = new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
Log.i(TAG, "******************************************");
Log.i(TAG, "The scan result " + result);
Log.i(TAG, "------------------------------------------");
}
};
This is my call:
mBluetoothLeScanner.startScan(mScanFilter, mScanSettings, mBLEScan);
It starts the scan but does not find any device. Please help me!!!!