# Quick Start

## Initializing the MOVE SDK

To be able to use the SDK, several permission need to be granted. This is described in [Permission Handling](/move-platform/move-sdk-1.x/sdk/appendix/android/permission-handling.md).

### Create SDK instance

Start by creating a SDK instance using the Move.Builder.

{% hint style="info" %}
It is recommended that the required permissions are requested before initializing the SDK.&#x20;
{% endhint %}

```kotlin
import io.dolphin.move.MoveSdk
...
var sdk: MoveSdk = MoveSdk.Builder()
    .transportModes(ModeOfTransport.DRIVING)
    .authentication(MoveAuth.Auth(productId,"contractId","accessToken","refreshToken"))
    .init(context)
```

{% hint style="info" %}
You need to replace **productId, contractId**, **accessToken,** and **refreshToken** with your own values.
{% endhint %}

{% hint style="warning" %}
In order to successfully initialize and run the SDK, the user's [MoveAuth ](/move-platform/move-sdk-1.x/sdk/models/moveauth.md)must already be fetched ([see also here](/move-platform/move-sdk-1.x/backend/getting-started-with-the-dolphin-move-timeline-service.md#register-user)), and the required [permissions ](/move-platform/move-sdk-1.x/sdk/appendix/android/permission-handling.md)must be granted. If the provided [MoveAuth ](/move-platform/move-sdk-1.x/sdk/models/moveauth.md)is invalid, the SDK will not initialize and complete with [MoveConfigurationError](/move-platform/move-sdk-1.x/sdk/models/moveconfigurationerror.md)`.AuthInvalid`. If the required permissions are missing, the SDK will initialize but go into missing permission error [State](/move-platform/move-sdk-1.x/sdk/models/movestate.md).
{% endhint %}

The initialization of the `MoveSdk` is asynchronous and you will be notified regarding state changes with the [MoveStateListener](https://docs.movesdk.com/move-platform/move-sdk-1.x/sdk/getting-started/android/pages/-MZIfp4AHvpUSOaycA60#DolphinSdk.Builderv1.1-sdkstatelistenerSdkstatelistener). The init can be called on the main thread or even on background threads. On successful initialization the [MoveSdkState](/move-platform/move-sdk-1.x/sdk/models/movestate.md) changes to `READY`.&#x20;

Now that there is an instance of the SDK, the detection may be started with [startAutomaticDetection()](/move-platform/move-sdk-1.x/sdk/api-interface/android-1/android.md#start-automatic-detection), which should lead to an `RUNNING` state of the `MoveSdk`.

{% hint style="warning" %}
The `MoveSdk`is collecting data only when in`RUNNING` state.
{% endhint %}

### Full code example

```kotlin
// Initialize sdk
 
moveAuth?.let {
   val moveSdk= MoveSdk.Builder()
    .timelineDetectionService(TimelineDetectionService.DRIVING, TimelineDetectionService.WALKING, TimelineDetectionService.BICYCLE)
    .drivingServices(DrivingService.DistractionFreeDriving, DrivingService.DrivingBehaviour)
    .recognitionNotification(recognitionNotification)
    .tripNotification(drivingNotification)
    .sdkStateListener(sdkStateListener)
    .authStateUpdateListener(authListener)
    .tripStateListener(tripStateListener)
    .authentication(moveAuth)
    .init(applicationContext);
...
 
... 
// in your MoveSdk.StateListener
  onStateChanged(sdk: MoveSdk, state: MoveSdkState) {
   val state = moveSdk.getSdkState()
   if (state is Ready) {
     moveSdk.startAutomaticDetection()
   }
  }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.movesdk.com/move-platform/move-sdk-1.x/sdk/getting-started/android/quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
