Initialization
API Interface / Android
Init
The Android MOVE SDK must be initialized by adding MoveSdk.init() at the first line in your Android Application class (onCreate). This instance can then be used to control MOVE SDK services.
After the MOVE SDK has been initialized you also want to add notifications, listeners or activate additional features.
Also you have to configure the MOVE SDK before you are able to call .setup(...).
By clicking the links below you can find further information about the usage.
Config
Whenever you are ready to start the Move SDK, setup() needs to be called with a proper configuration. The following code sample demonstrates a common configuration with driving, walking, cycling, automatic impact detection and assistance call.
Setup
It is recommended to set up notifications before calling the setup() method.
It is recommended that .setup(...) is called ONLY ONCE!
If .shutdown() was called before then .setup(...) must be redone.
With MoveAuth
auth
config
The move configuration
start
Boolean
options
optional: added with v2.3.+
With authCode
authCode
String
config
The move configuration
start
Boolean
options
callback
MoveAuthCallback
Example of implementing the MoveAuthCallback:
Listeners
Initialization listener
Parameter
Description
listener
Block that gets invoked on initialization completion with error. On error,
Auth state update listener
Callback
AuthStateUpdateListener
MOVE SDK State listener
Parameter
Description
listener
Trip state listener
Parameter
Description
listener
Trip notifications
Parameter
Description
notification
The notification builder to build the notification
Walking notifications
Parameter
Description
notification
The notification builder to build the notification
Recognition notifications
Parameter
Description
notification
The notification builder to build the notification
Trip 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 MOVE SDK will not use this metadata element in any way, it is just passed through to the project.
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.
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
Parameter
Description
context
Main application context.
Return
MoveSdk
The instance of the MoveSdk
Throws
MissingAuthenticationException
If the passed configuration is missing, e.g. empty access token
Last updated