Skip to main content

Android Migration Guide

If you are using the Zendrive SDK, this guide will help you with the quick steps you need to follow to migrate to 3.x version of the Leeo SDK.

warning

Copy the Leeo SDK key, available in the advanced tab of the settings screen on the Leeo dashboard. Use the Leeo SDK key for the Leeo SDK. Note that the Leeo SDK key can NOT be used with the Zendrive SDK or vice versa.

1. Update the dependency version in your build files

implementation 'com.fairmatic:sdk:3.0.2'

2. Add drivequant maven to your repositories block (settings.gradle or build.gradle )

repositories {
maven {
url "https://maven.drivequant.com/repository/android-sdk/"
}
}

3. Bump your minSdk version to 26

minSdk 26

4. Remove your ZendriveBroadcastReceiver implementation and all its usages

5. Remove your ZendriveNotificationProvider implementation and all its usages. This has been changed as a parameter on the setup method (LeeoTripNotification)

6. Split ZendriveDriverAttributes alias into 2 parameters - firstName & lastName

private val fairmaticDriverAttributes = FairmaticDriverAttributes(
firstName = "John",
lastName = "Doe",
email = "john_doe@company.com",
phoneNumber = "1234567890"
)

7. Use FairmaticSettingsCallback, instead of ZendriveSettingsCallback. Change onComplete List<FairmaticSettingError>

object : FairmaticSettingsCallback {
override fun onComplete(errors: List&#x3C;FairmaticSettingError>) {
...
}
}

8. Replace all the Zendrive.startPeriodX() API calls with Fairmatic.startPeriodX(). Also, the startPeriod1() API accepts a trackingId string on the Leeo SDK to stay consistent with the other insurance period APIs.

9. Leeo.isValidInputParameter(driverId) is now removed. You'll get all errors in the callback result (FairmaticOperationResult.Error)