3

I read this Issue.

I want to make one sample app to read the all BLE device rssi near of my application range without connecting them.

I create STICKY service & access near device scan result.

BluetoothManager mBluetoothManager = (BluetoothManager) getSystemService(SmartIDService.this.BLUETOOTH_SERVICE);
        mBluetoothAdapter = mBluetoothManager.getAdapter();

//Start Scan.
mBluetoothAdapter.startLeScan(mLeScanCallback);

//Listen scan Resul.
private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback()
    {

        @Override
public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord)
        {           
            AppLogger.showDebugLog(TAG + "rssi: " +rssi);

        }
    }; 

I got the result as I want,but if BLE device out of range for some time I can't get the result again. I think that startLeScan() is remove from memory, so I create One alarm service to wakt up mBluetoothAdapter.startLeScan(mLeScanCallback); some time interval & issue is resolved. But I can't find the actual time interval that I will wake up alaram service.

any solution !!!
idea time interval for every device?
Any other process?

please guide me

Zala Janaksinh
  • 2,929
  • 5
  • 32
  • 58

0 Answers0