CloseToMe, an Android BLE library
Using Bluetooth Low Energy Beacons to do contact tracing
The idea behind the library
While everyone was in the fight with the COVID-19 pandemic our team was thinking about what can help to the post-pandemic era. The time governments allow people to move out of their caves and get back to their normal life.
The main idea was tracing user close contacts and record that data on the user phone anonymously, a solution totally aligned with GDPR (European Union’s General Data Protection Regulation). The moment a user gets a positive COVID result we broadcast that specific user’s anonymous ID and share it with all the other users to ping those who were in close contact with the sick person.
A week after we started the CoviLights open-source Android application, Google and Apple also agreed and announced a similar idea to provide an API and hopefully, they will release it soon:
Apple and Google partner on COVID-19 contact tracing technology
Across the world, governments and health authorities are working together to find solutions to the COVID-19 pandemic…
However, this won’t stop me from releasing this library which can come handy for other use-cases. Also having in mind that not all Android phones come with the latest Google Play Services and developers in countries under sanctions or limitations may want to do the same by themselves.
How does it work?
The CloseToMe Android library uses Bluetooth Low Energy API to simulate an iBeacon. Needless to any long-lasting painful pairing or bonding and only by advertising a client and scanning for the other clients, we can trace each client anonymously. Beacons can be filtered using their Manufacturer UUID and distinguishable by their Major and Minor which are unsigned short numbers (between 1 and 65535 per each) but this is not enough to have a unique client!
To address this limitation this library can also advertise a user UUID which is unique enough to allow determine clients from each other.