This is the error i am getting:
Attempt to invoke virtual method 'void android.bluetooth.le.BluetoothLeScanner.startScan(android.bluetooth.le.ScanCallback)' on a null object reference
I tried adding coarse_location permissions both in manifest and at run time but it didn't work and also turned on location. Can someone help me in this.
I use this to scan Low energy devices.
mBluetoothLeScanner.startScan(mLeScanCallback);
This is my scancallback.
final ScanCallback mLeScanCallback = new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
final int new_rssi = result.getRssi();
addDevice(result, new_rssi);
super.onScanResult(callbackType, result);
}