Quick Start
Getting Started / Android
Setup the MOVE SDK
Code example
// in your application class
override fun onCreate() {
// init the MOVE SDK
val moveSdk = MoveSdk.init(this)
super.onCreate()
// Example of adding some notifications, register listener
// and activate MOVE SDK features.
moveSdk.apply {
recognitionNotification(recognitionNotification)
tripNotification(drivingNotification)
sdkStateListener(sdkStateListener)
tripStateListener(tripStateListener)
authStateUpdateListener(authStateListener)
initializationListener(initListener)
initiateAssistanceCall(assistanceListener)
consoleLogging(true)
}
...
// Configuration of the MOVE SDK
val moveServices: MutableSet<MoveDetectionService> = mutableSetOf()
val drivingServices: MutableSet<DrivingService> = mutableSetOf()
drivingServices.add(DrivingService.DrivingBehaviour)
drivingServices.add(DrivingService.DistractionFreeDriving)
val walkingServices: MutableSet<WalkingService> = mutableSetOf()
walkingServices.add(WalkingService.Location)
moveServices.add(MoveDetectionService.Driving(drivingServices = drivingServices.toList()))
moveServices.add(MoveDetectionService.Walking(walkingServices = walkingServices.toList()))
moveServices.add(MoveDetectionService.Cycling)
moveServices.add(MoveDetectionService.AutomaticImpactDetection)
moveServices.add(MoveDetectionService.AssistanceCall)
val moveConfig = MoveConfig(moveDetectionServices = moveServices.toList())
...
MoveAuth(
projectId = projectId ?: 0L,
userId = userId ?: "",
accessToken = accessToken ?: "",
refreshToken = refreshToken ?: ""
)
...
moveSdk.setup(
auth = auth,
config = moveConfig,
start = false,
motionPermissionRequired = true
)
}Last updated