Most of times it works great but sometimes i\'m having this error while trying to discover BLE devices:
02-12 18:00:41.952 16178-16339/com.icrealtime.allie W/Bl
A possible workaround it might be to disable/enable the blueetooth programmatically. When you got the error SCAN_FAILED_APPLICATION_REGISTRATION_FAILED you should disable the BluetoothAdapter:
BluetoothAdapter.getDefaultAdapter().disable();
Disabling BluetoothAdapter, the event STATE_TURNING_OFF is fired. Once this event is fired, try to reconnect to the BluetoothAdapter:
case BluetoothAdapter.STATE_OFF:
Log.d(TAG, "bluetooth adapter turned off");
handler.postDelayed(new Runnable() {
@Override
public void run() {
Log.d(TAG, "bluetooth adapter try to enable");
BluetoothAdapter.getDefaultAdapter().enable();
}}, 500);
break;