// initialize callbackval callback =object : TrackingStateListener {overridefunonStopTracking() {// tracking stopped } overridefunonStartTracking() {// tracking started } }// register it in SDKTrackingApi.getInstance().registerCallback(callback)
Callback to be invoked when new location was found
This feature is available from 2.2.228 version. Latest release you can check onChangelog page
// initialize callbackval callback =object : com.raxeltelematics.v2.sdk.LocationListener {overridefunonLocationChanged(location: Location?) {// your logic here } }// register it in SDKTrackingApi.getInstance().setLocationListener(callback)// Don't forget to remove callback by passing null to this method when it is not neededTrackingApi.getInstance().setLocationListener(null)
Speed violation callback
val callback =object : com.raxeltelematics.v2.sdk.SpeedViolationsListener {overridefunonSpeedViolation(violation: SpeedViolation) {// your logic here } }// register it in SDKTrackingApi.getInstance().registerSpeedViolations(speedLimit, speedTimeout, callback)// Don't forget to remove callback by passing null to this method when it is not neededTrackingApi.getInstance().unregisterSpeedViolationCallback()