Search code examples
ibeaconandroid-bluetoothibeacon-androidaltbeaconandroid-ibeacon

Integrating altbeacon with BluetoothCrashResolver


I have an app that uses the altbeacon Android Beacon Library to do iBeacon monitoring and ranging, and I'm trying to handle the "Bluetooth share has stopped" crash.

I've followed the instructions to copy in the BluetoothCrashResolver class seen here (https://github.com/RadiusNetworks/bluetooth-crash-resolver) and initialize it in the class that does the ranging. My question is, how do I expose the proper BluetoothDevice and BluetoothAdapter.LeScanCallback parameters in order to call notifyScannedDevice upon discovery of an iBeacon?

Thanks in advance!


Solution

  • Recent versions of the Android Beacon Library (dating back 18 months) already have integration with the Bluetooth Crash Resolver out-of-the box. There is no need to do any configuration as it is enabled automatically.

    It is important to note, however, that the Bluetooth Crash Resolver is not a panacea for preventing crashes on Android 4.3 and 4.4. It works well on Nexus and other devices with close to stock Android. It works less well with some heavily modified Samsung ROMs.