It should work on Android and iOS, but code not so clean. I created it as proof-of-concept of crossplatform app that interacts with fitness bracelet.
- https://github.com/AL3X1/Mi-Band-2-SDK - was used as an example of interaction with MI Band 2.
- https://github.com/xabre/xamarin-bluetooth-le - used as main Bluetooth LE library it's installed by Nuget.
- Install MiFit application
- Pair your bracelet with MiFit app.
- Enable "Discovery" setting for bracelet (in MiFit app).
- Ensure that Blueetoth enabled and bracelet connected to phone.
- Build and run project for your platform (iOS, Android)
Mi Band 2 implements default heart rate service that described in Bluetooth GATT Specification, here: https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=239866, all services can be found here: https://www.bluetooth.com/specifications/gatt. I've used xamarin-bluetooth-le library to interact with bracelet. Interaction steps:
- Resolving a device .
- Connecting to the device.
- Subsribing to heart rate update event.
- Starting heart rate measurement process.
- https://github.com/inFullMobile/inFullBand - sample iOS App for interacting with MI Band 2
- https://github.com/aashari/mi-band-2 - Android app to interact with Mi Band 2.
- https://blog.infullmobile.com/introduction-to-bluetooth-le-on-ios-mi-band-2-case-study-343153921877 - interesting article about implementing iOS app and interact with Mi Band 2.