bluetooth-lowenergy
iBeacon in the background – Use cases
Sounds like you are on the right track. In general you are correct that an app needs to be in the foreground to fully use iBeacon capabilities. A few specifics on your three main questions: Your mall use case can work with a couple of limitations. (a) you have to conserve your CLBeaconRegions by having … Read more
Finding distance from RSSI value of Bluetooth Low Energy enabled device
I answered this in another thread, repeating it here. In line-of-sight (no obstacles causing change in RSSI), -6dB seems to be double the distance. If you at 1m distance read RSSI -40dB then 2m gives -46dB, 4m gives -52dB, 8m gives -58dB, 16m gives -64dB. You can not get an exact position, only a circular … Read more
startLeScan with 128 bit UUIDs doesn’t work on native Android BLE implementation
@Navin’s code is good, but it includes an overflow bug from the original 16-bit Android code. (If either byte is larger than 127 then it becomes a negative integer.) Here’s an implementation which fixes that bug and adds 128-bit support: private List<UUID> parseUuids(byte[] advertisedData) { List<UUID> uuids = new ArrayList<UUID>(); ByteBuffer buffer = ByteBuffer.wrap(advertisedData).order(ByteOrder.LITTLE_ENDIAN); while … Read more