Introduction
We build up the medical IoT platform called OmniCare, collecting different kinds of vital signs data from our partners’ devices, in order to be more convenient for third party integration with their application we have developed the OmniCare SDK.
It can easy to communicate with ASUS VivoWatch BP, such as create a connection channel, connect device, upload device vital signs data to OmniCare and retrieve the vital signs data back from OmniCare.
System Requirements
Target OS: Android 5.0 (API Level 21) or higher.
How it works
See the sequence diagram below, it shows how does OmniCare SDK work.
Getting Started
Adding the OmniCare SDK to an Android Studio Project
The OmniCare SDK is distributed as aar file. To add it to your project, copy OmniCareSDK.aar to the libs folder and add the following to your build.gradle.
repositories { dependencies { |
Permissions & Service
Add the properties in manifest file. For Android 6.0+, users grant permissions to apps while the app is running, not when they install the app. Please refer official document to add necessary code: https://developer.android.com/training/permissions/requesting.html.
<uses-permission android:name="android.permission.BLUETOOTH" /> |
Add the <service> tag below, contained in <application> tag in manifest file.
<service |
Dependencies
The OmniCare SDK has dependencies on the following third-party library that will need to be included in you project.
build.gradle file
compile 'com.google.code.gson:gson:2.7' |
How to use the OmniCare SDK
Before using the OmniCare SDK, you need to initialize it first. AsusLifeOmniCare.initialize() must be added to all entry point Activities.
AsusLifeOmniCare.initialize(context, account, password, new AsusLifeOmniCareInitializationCallback() { } } }); |
Device Communication
Finding OmniCare Devices
The first step in communication is finding a device to communicate with. The BLE scanning APIs provided by the Android SDK are used for this.
After you hold the Location permission, you have also to verify that Location services are enabled before starting the scan.
private void verifyLocationServices() { |
With the prerequisites taken care of, we can start the scan. BluetoothLeScanner requires a ScanCallback to return results of the scan. AsusLifeDeviceScanCallback is provided to filter the scan results to only include OmniCare devices that are supported by the SDK. You must extend this class to get the results of the scan.
private AsusLifeDeviceScanCallback asusLifeDeviceScanCallback = new AsusLifeDeviceScanCallback() { … DeviceManager deviceManager = AsusLifeOmniCare.getDeviceManager(); deviceManager.startScan(asusLifeDeviceScanCallback, millis); ... |
Pairing a Device
Attempt to pair a scanned device returned from BLE scanning in the SDK.
private PairingCallback pairingCallback = new PairingCallback() { … DeviceManager deviceManager = AsusLifeOmniCare.getDeviceManager(); deviceManager.requestDevicePair(scannedDevice, pairingCallback); ... |
Syncing & Uploading Data
As the device has been paired, using the method below to sync the vital signs data from device and upload the data to OmniCare.
private SyncingCallback syncingCallback = new SyncingCallback() { // Called if syncing fails. … DeviceManager deviceManager = AsusLifeOmniCare.getDeviceManager(); deviceManager.requestDeviceSync(device, syncingCallback); ... |
Vital Signs Data Integration
Through OmniCare Platform
After the device syncing is successful, using method below to request vital signs data from OmniCare.
OmniCareAPI.getDataByDevcie(device, startTime, endTime, new OmniCareAPI.DataRequestCallback() { // Called when the data requesting process completes successfully. // Called if data requesting fails. |
Release Notes
V1.4.0(March 2020)
1.Modified GetTokenResponse model(removed sguri).
2.Modified OmniCareECGData model.
3.Added OmniCarePPGData model.
4.Exporting ECG, PPG data from ASUS VivoWatch BP.
V1.3.0(January 2020)
1.Set the bluetooth connection service to foreground, you can customize your own foreground service parameters from strings.xml file(keys: omnicaresdk_foreground_service_title, omnicaresdk_foreground_service_message, omnicaresdk_foreground_service_channel_name), it will run in the foreground after OmniCareSDK is initialized.
2.Fixed the sleep data missing issue.(ASUS VivoWatch BP)
3.Revised the sleep data format.(ASUS VivoWatch BP)
4.Added the location data model and ASUS VivoWatch BP exercise mode data paring.
V1.2.2(January 2020)
1.Fine tune ASUS VivoWatch BP phone call feature
2.Don't forget to add "<uses-permission android:name="android.permission.READ_CONTACTS"/>" to your AndroidManifest.xml file:
<manifest
...
<uses-permission android:name="android.permission.READ_CONTACTS"/>
...
</manifest>
V1.2.1(January 2020)
1.Fine tune BLE connection
2.Fine tune notification feature
3.Custom label for NotificationListenerService, example as below, added it to your AndroidManifest.xml file:
...
<application
...
<service android:name="com.asuslife.omnicaresdk.NotificationListenerService"
android:label="Custom"
tools:replace="label"/>
...
</application>
...
V1.2.0(December 2019)
1.New feature
-Added notification setting options to VivoWatch BP
V1.1.1(December 2019)
1.Bug fix
-Solving Activity -> Activity data transferring problem.
V1.1.0(November 2019)
1.New feature
-FW update
-Pill reminder
-Frequency of checks setting
V1.0.0
1.New release.
Reference
Please see javadoc for more information.