Real time trip events

Introduction

Documentation is provided using Kotlin language.

Real time events

Fill in the folowing functions when you want to be updated with real-time events

class DrivingEventListener: Driving.EventListener {  
    override fun onTripStarted(time: Date, location: Location) {
        /* Trip was started. */
    }
    override fun onTripFinished(time: Date, location: Location) {
        /* Trip ended. */
    }
    override fun onTripDiscarded(reason: TripDiscardReason) {
        /* Trip ended, but was discarded because it was too short. */
    }
    override fun onEventStarted(event: TripEvent) {
        /* A trip event was detected */
    }
    ...
}

Driving.getInstance().addEventListener(drivingEventsListener)
Driving.getInstance().removeEventListener(drivingEventsListener)