I am currently developing an application that will use Bluetooth Low Energy.
I am using the following link,
I am not able to scan the surrounding BLE devices.
To scan device,
mBluetoothAdapter.startLeScan(mLeScanCallback);
private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback()
{
@Override
public void onLeScan(final BluetoothDevice device, int rssi,byte[] scanRecord)
{
runOnUiThread(new Runnable() {
@Override
public void run()
{
mLeDeviceListAdapter.addDevice(device);
mLeDeviceListAdapter.notifyDataSetChanged();
}
});
}
};
If You are using 23 API or higher: You have to add location permission
These all permissions in manifest:
I had the same problem please add these permissions to your manifest