$drivekit_version
with the DriveKit version you are using in your appREQUEST_IGNORE_BATTERY_OPTIMIZATIONS
permission in AndroidManifest.xml file of your application.onCreate
method of your application class.TripNotification
object as parameter, and an optional implementation of TripListener
.TripListener
interface includes 5 methods to implement:tripStarted(startMode : StartMode)
: This method is called each time a trip's started. StartMode
indicates which event starts the trip. Possible values are described here.tripPoint(tripPoint: TripPoint)
: This method is called when a trip's started and confirmed, for each GPS point recorded by the SDK. Data available in TripPoint
object are described here.tripSavedForRepost()
: This method is called if at the end of the trip, the trip can be sent to DriveQuant's server for the analysis. The trip is saved locally on the SDK and will sent later.tripFinished(post: PostGeneric, response: PostGenericResponse)
: This method is called when a trip has been recorded by the SDK and sent to DriveQuant's server to be analyzed. PostGeneric
contains raw data sent to DriveQuant's server, PostGenericResponse
object contains the trip analysis made on DriveQuant's server. Detailed description of these data are available here.beaconDetected()
: This method is called when a beacon sets in the SDK is detected.sdkStateChanged(state: State)
: This method is called every time the state of the SDK changed with the new state as parameter. States are described here. true
if it is well configured.carTypeIndex = 1
carEngineIndex = 1
carPower = 150
carMass = 1
carGearboxIndex = 2
carConsumption = 4.5
TripAnalysedReceiver
and implements the 2 methods onTripReceived
and onTripCancelled
.onTripReceived(context: Context, post: PostGeneric, response: PostGenericResponse)
: This method is called when a trip has been recorded by the SDK and sent to DriveQuant's server to be analyzed. PostGeneric
object contains raw data sent to the server, PostGenericResponse
object contains the trip analysis made on the server. Detailed description of these data are available here.onTripCancelled(context: Context, status: CancelTrip)
: This method is called when a trip is cancelled. CancelTrip
indicates which event cancels the trip. Possible values are described here.onCreate
method of your application class, you have to register your class as a broadcast receiver to action com.drivequant.sdk.TRIP_ANALYSED
.false
if the SDK is in INACTIVE
state, and no trip is currently running.INACTIVE
: No trip is running.STARTING
: The auto start mode detects a movement of the user and checks if it's a trip in vehicle.RUNNING
: The trip has been confirmed by the speed of the movement.STOPPING
: The SDK is in this state when a potential trip end is detected. If the trip continues, the SDK goes back to RUNNING
state. The duration of the stopping state can be configured.SENDING
: The trip is completed and sent to DriveQuant's server. When the SDK receives the response from the server, it switches to INACTIVE
state, waiting for the next trip.