Skip to content
On this page

Analytics

The SDK can collect usage analytics in order to improve the product. No sensitive user info or details are saved.

Integration

Add this line to your app's build.gradle file:

dependencies {
    ...
    implementation 'com.segment.analytics.kotlin:android:1.16.3'
}

API

Kotlin
try {
    val licenseDetails = LicenseDetails("<ENTER_YOUR_LICENSE_KEY>")
    val session = FaceSessionBuilder(applicationContext) 
                    .withDeviceOrientation(DeviceOrientation.LANDSCAPE_LEFT)
                    .withImageListener(this)
                    .withVitalSignsListener(this)
                    .withSessionInfoListener(this)
                    .withAnalytics() 
                    .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>");
    Session session = new FaceSessionBuilder(getApplicationContext()) 
                    .withDeviceOrientation(DeviceOrientation.LANDSCAPE_LEFT)
                    .withImageListener(this)
                    .withVitalSignsListener(this)
                    .withSessionInfoListener(this)
                    .withAnalytics() 
                    .build(licenseDetails);
} catch (HealthMonitorException e) {
    Log.i("ERROR", "Received Error. Domain: "+ e.getDomain() +" Code: "+ e.getErrorCode());
}