Best practice for storing BTLE information for reconnecting on app restart

So I'm able to detect, connect, and communicate with my bluetooth device. I would like to be able to automatically restore this connection when the app starts up cold.

While the user is unlikely to have more than one of the same device, it's possible. Also, down the road if more devices are supported I need a way to distinguish between (potentially) one or more devices that aren't the same make/model.

Due to some limitations with what I can get out of the ScanResult, I can't detect the device's address or anything usable to uniquely identify it, so I'm trying to figure out how to recognize that a device has been previously selected by the user.

Can I store an entire ScanResult to storage and use isSameDevice() ? Is there some way I can query ScanResult/Device/... to try and get the device address?

Or do I have to blindly scan and cross my fingers hoping to find the device that was selected? 

  • Right now, you must scan each time the app runs, as there is no way to save off the scan result and reuse it the next time an app runs.Saving the scan result was something I suggested when BLE was first introduced.

    As far as ID'ing a specific device, on some things I see a different in the name, like "HRM-123" were another might be "HRM-789"

    Another thing you could do is check the RSSI and connect to the closest one.