Recently, I’ve created yet another reactive library for Android. It’s called ReactiveBeacons and it’s responsible for observing BLE (Bluetooth Low Energy) beacons. Beacons are small devices, which became quite popular in the last years. They can be utilized in creating Contextual Awareness, Contextual Computing and Internet of Things. Beacons have lithium battery, are constantly turned on and emit signals via Bluetooth all the time. ReactiveBeacons library allows to transform these signals into Observable stream compatible with RxJava. Whenever new beacon is detected or RSSI (Received signal strength indication) changes, new immutable beacon data is emitted.
Usage of the library inside the Activity is simple:
We also have to remember to unregister subscription correctly in order to stop BLE scan, which can drain the battery.
If you want to use this library in your project, add the following dependency to your
Don’t forget to add dependency to RxAndroid if you want to use Android-specific features of RxJava.
Source code of the library can be found at: https://github.com/pwittchen/ReactiveBeacons.
Any new issues or pull requests are welcome!