I am working for a android BLE library for our team, the library is developed with 4.3 native framework, I try to keep a table of the found BLE device, and send a notification when I find a new BLE device who is not in my found device table, instead of informing each time when the device is found (default behaviors by android BLE framework), the problem is I can't detect the device is gone, in consideration of that I don't want to establish the BLE connection with it. Anyone can help me out? I suppose that there is some way to do this, like the iOS framework, u can be informed when the device is gone without connecting to it.
The basic strategy to "undiscover" a device is to keep track of the last time a device was discovered and once every second or so iterate through your list of devices. If the current time minus the last time the device was discovered is greater than some time delta (I use 12.5 seconds) then you consider the device undiscovered and remove it from your list.
Some gotchas with this:
I've also heard of people using RSSI. Low RSSI means you undiscover it, but I experienced a lot of false positives with this approach as well.