Appearance
PPG Device Session
Besides measurements using the camera, the SDK also supports Vital Sign measurements using Polar Verity Sense device.
Creating a PPG Device session is done by using the PolarSessionBuilder
API
Kotlin
try {
val licenseDetails = LicenseDetails("<ENTER_YOUR_LICENSE_KEY>")
val deviceID = "<ENTER_POLAR_DEVICE_ID>"
val session = PolarSessionBuilder(applicationContext, deviceID)
.withVitalSignsListener(this)
.withSessionInfoListener(this)
.withPPGDeviceInfoListener(this)
.build(licenseDetails);
} catch (e: HealthMonitorException) {
Log.i("ERROR", "Received Error. Domain: ${e.domain} Code: ${e.errorCode}")
}
Java
try {
LicenseDetails licenseDetails = new LicenseDetails("<ENTER_YOUR_LICENSE_KEY>");
String deviceID = "<ENTER_POLAR_DEVICE_ID>";
Session session = new PolarSessionBuilder(getApplicationContext(), deviceID)
.withVitalSignsListener(this)
.withSessionInfoListener(this)
.withPPGDeviceInfoListener(this)
.build(licenseDetails);
} catch (HealthMonitorException e) {
Log.i("ERROR", "Received Error. Domain: "+ e.getDomain() +" Code: "+ e.getErrorCode());
}
During session initialization, the SDK attempts to connect with the specified PPG Device using the provided device type and device ID. The session transitions to the READY state only when the connection is established. Session creation may fail for various reasons, such as disabled Bluetooth on the mobile device or an outdated PPG device firmware. For detailed error information, please consult the Alerts List.