Dolphin MOVE SDK
SDK
1.x
1.x
  • Introduction
  • MOVE Services
  • MOVE SDK
    • Getting Started
      • MOVE Dashboard
      • Android
        • Installation
        • Quick Start
      • iOS
        • Installation
        • Quick Start
      • React Native
    • API Interface
      • Android
        • Initialization
        • Services
      • iOS
        • Initialization
        • Services
      • React Native
        • Initialization
        • Services
    • Models
      • MoveAuth
      • MoveConfig
      • MoveConfigurationError
      • MoveDeviceStatus
      • MoveSDKState
      • MoveTripState
      • MoveAuthState
      • Listeners/Callbacks
    • Appendix
      • Android
        • Token refresh
        • Permission Handling
        • Battery optimization
        • Notification Management
      • iOS
        • Permissions Handling
        • App Store
  • MOVE Backend
    • MOVE Timeline
    • MOVE State
    • MOVE Last Location
    • MOVE Generic Notifier
    • Open Api Specification
  • Changelog
    • Android
    • iOS
  • Data privacy (GDPR)
Powered by GitBook
On this page
  • Builder
  • Authentication
  • Timeline detection services
  • Driving services
  • Other services
  • Initialization listener
  • Auth state listener
  • MoveSdk State listener
  • Trip state listener
  • Trip notifications
  • Recognition notifications
  • Mock locations
  • Metadata
  • Initialization
  1. MOVE SDK
  2. API Interface
  3. Android

Initialization

This page shows what can be configured for the MOVE SDK.

PreviousAndroidNextServices

Last updated 3 years ago

Builder

The Android MOVE SDK must be initialized by using the MoveSdk.Builder. It can be configured with different configurations. Once the configuration is passed, must be called to initialize and retrieve an instance of the MOVE SDK. This instance can then be used to control SDK services. Check for more details.

Authentication

To be fetched using the given product’s API Key.

.authentication(auth: MoveAuth)

auth

The user's Auth object.

SDK Authentication

Passing the authentication config is required for each initialization. The host app is also responsible for monitoring the auth state changes.

Timeline detection services

.timelineServices(vararg modes: TimelineDetectionService)

Parameter

Description

modes

The modes of transport host app require tracking.

Driving services

.drivingServices(vararg modes: DrivingService)

Parameter

Description

modes

Driving services host app require tracking.

Other services

.otherServices(vararg modes: OtherService)

Parameter

Description

modes

Other services host app requires tracking.

Initialization listener

.initialization(listener: MoveInitializeListener)

Parameter

Description

listener

Auth state listener

fun authStateUpdateListener(callback: AuthStateUpdateListener)

Callback

AuthStateUpdateListener

Authentication Expiry

MoveSdk State listener

.sdkStateListener(listener: MoveSdkStateListener)

Parameter

Description

listener

Trip state listener

.tripStateListener(listener: MoveTripStateListener)

Parameter

Description

listener

Trip notifications

.tripNotification(notification: Notification.Builder)

Parameter

Description

notification

The notification builder to build the notification

Recognition notifications

.recognitionNotification(notification: Notification.Builder)

Parameter

Description

notification

The notification builder to build the notification

Mock locations

In Android it is possible to use simulated location by enabling it in the device developer mode. If you want the MOVE SDK to support those locations, you need to specify it. By default this is disabled to prevent wrong data.

Points of Interests are not supported with mock locations. Keep in mind that mock locations may have negative impact on trip recognition afterwards.

Rooted devices are still able to send mock locations without allowing mock locations.

.allowMockLocations(allow: Boolean)

Parameter

Description

allow

Allows driving with mock locations. Should only be used in debug/test builds

Metadata

Host apps can use this API to add any app-level information (for ex. bluetooth beacon detected, foreground/background time, etc) to append to a trip as metadata. This metadata will be forwarded back along with the trip when fetched by the client-server, so the host app can utilize it in its app. Note: The SDK will not use this metadata element in any way, it is just passed through to the product.

The block provides the trip's start and stop times. Make sure to only include metadata events that are collected inside the given start and end periods.

.metadataProvider(provider: TripMetadataProvider)

Parameter

Description

Callback to provide a bundle of key-value pairs to a trip. The trip is represented with a given start and stop time.

Initialization

Application Context

Make sure to pass the application context

Parameter

Description

context

Main application context.

fun init(context: Context): MoveSdk

Return

MoveSdk

The instance of the MoveSdk

Throws

MissingAuthenticationException

If the passed configuration is missing, e.g. empty access token

Block that gets invoked on initialization completion with error. On error, is returned. On success, the will change accordingly.

Block that gets invoked on initialization completion with error. On error, is returned.

Provide a block to be invoked every time changes.

Block that gets invoked every time is updated.

The host app is expected to monitor updates viaauthStateUpdateListener(Android / ) API and handle those changes accordingly.

Check for more details about authentication expiry and renewal.

Provide a block to be invoked every time changes.

The host app is expected to be monitoring changes so it can start the SDK services when is.readyor handle errors if occurred.

Block gets called whenever the changes.

A listener where gets called whenever the changes

Passes a notification builder which is used to create a notification while on an active trip. For more information on that please check.

Passes a notification builder which is used to create notification while detecting activities, trips and more. For more information on that, please check.

Tries to initialize the SDK based on the given configuration. You can only have one initialized MoveSdk at a time. If you have a MoveSDK instance already, consider calling before. The initialization process is asynchronous and the host app is expected to register a to monitor successful initialization and start services when transits toREADY . The host app should also monitor to handle potential .

If you have already successfull initialized the MOVE SDK once, try to initialize the SDK next time in your application in . This ensures that the SDK can do its work whenever the application is restarted after termination.

MoveConfigurationError
MoveSdkState
MoveAuthState
MoveSdkState
MoveSdkState
MoveSdkState
notification management
notification management
onCreate
API Interface
init
MoveAuth
TimelineDetectionService
DrivingService
OtherService
MoveConfigurationError
MoveAuthState
MoveSdkState
MoveTripState
onTripStateChanged
MoveAuthState
MoveSDKState
MoveSdkState
MoveConfigurationError
listener
initialization listener
Authentication updates and expiry
shutdown
iOS
InitializeListener
MoveSdkStateListener
MoveTripStateListener
provider