---
updatedAt: 2026-05-21T09:44:26.000Z
agentTools:
  projectIndex: https://docs.damoov.com/llms.txt
---

# Framework for Android app

Configure the simplest way to work with User login and auth

## Telematics authorization library for Android

[block:embed]
{
  "html": false,
  "url": "https://github.com/Mobile-Telematics/LoginAuthFramework-Android",
  "title": "Mobile-Telematics/LoginAuthFramework-Android",
  "favicon": "https://github.com/favicon.ico",
  "image": "https://opengraph.githubassets.com/69b618fdc5e4cf094d5b5ab82fd6299d63387a07345bcf9682c6bd7eb8f61abb/Mobile-Telematics/LoginAuthFramework-Android"
}
[/block]

### Description

This library is created by DATA MOTION PTE. LTD. and allows you to integrate with our UserService API in a few steps.

LoginAuth Framework main functions:

1. Register `deviceToken` for each new Telematics SDK user.
2. Refresh the `accessToken (JWT)` when it is expired.
3. Authorize existing SDK user
4. Get authorized user profile info
5. Update authorized user profile info

### Credentials

Before you start using the library, make sure you registered a company account in the [DataHub](https://app.damoov.com/) and obtained `InstanceId` and`InstanceKey`. If you are new, please refer to the [documentation](https://docs.damoov.com/) and register your company account in DataHub. [Sing Up](https://app.damoov.com/user/registration)

### LoginAuth Framework setup

Here you can find a short video guide, how to add LoginAuth Framework to your iOS app:

[block:embed]
{
  "html": "<iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjpdLDzMdCuw%3Ffeature%3Doembed&display_name=YouTube&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjpdLDzMdCuw&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjpdLDzMdCuw%2Fhqdefault.jpg&key=f2aa6fc3595946d0afc3d76cbbd25dc3&type=text%2Fhtml&schema=youtube\" width=\"854\" height=\"480\" scrolling=\"no\" title=\"YouTube embed\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen=\"true\"></iframe>",
  "url": "https://www.youtube.com/watch?v=jpdLDzMdCuw&feature=youtu.be",
  "title": "Android LoginAuth Framework Integration Guide",
  "favicon": "https://www.youtube.com/s/desktop/4eebcda0/img/favicon.ico",
  "image": "https://i.ytimg.com/vi/jpdLDzMdCuw/hqdefault.jpg"
}
[/block]

### Basic concepts

`deviceToken` - is the main individual SDK user identifier for your app. This identifier is used as a key across all our services.

`accessToken` - or JSON Web Token (JWT) is the main UserService API key, that allows you to get user individual statistics and user scoring by UserService APIs calls.

`refreshToken` - is a secret key that allows you to refresh the `accessToken` when it expires.

### Setup

1. Add our maven-repository to your `build.gradle` file:

```groovy
maven {
    url "https://s3.us-east-2.amazonaws.com/android.telematics.sdk.production/"
}
```

2. Import library:

```groovy
dependencies {
    implementation "com.telematicssdk:auth:1.0.0"
}
```

3. If you are using R8 or ProGuard add this line to options:

```
    -keep public class com.telematicssdk.auth.** {*;}
```

### Example

Let's dive in and see the library's API. The main entry point of the library is `TelematicsAuth` object.
It's a Kotlin `Object` (or static class for Java users) that contains inside all methods.

Every method returns a `Task` class. It's a task that should be processed and contains inside callbacks about success or error.

Let's see how it work. In this example we will register a new empty user (without additional fields):

Call `TelematicsAuth.createDeviceToken` method that takes an `instanceId`, `instanceKey` and creates a new empty user:

```kotlin
    TelematicsAuth.createDeviceToken(
        instanceId = "<your instanceId>",
        instanceKey = "<your instanceKey>")
    .onSuccess { result ->
        println(result.deviceToken)
        println(result.accessToken)
        println(result.refreshToken)
    }
    .onError { e ->
        e.printStackTrace()
    }

```

That's it! Now you are ready to use our authorization library.

Also you can check [references in our doc](https://mobile-telematics.github.io/LoginAuthFramework-Android/).

Happy coding!

### Links

[Official product Web-page](https://damoov.com/)

[Official API services web-page](https://www.damoov.com/api-services/)

[Official SDK and API references](https://www.damoov.com/api-services/)

[Official ZenRoad web-page](https://www.damoov.com/telematics-app/)

[Official ZenRoad app for iOS](https://apps.apple.com/jo/app/zenroad/id1563218393)

[Official ZenRoad app for Android](https://play.google.com/store/apps/details?id=com.telematicssdk.zenroad\&hl=en\&gl=US)

[Official ZenRoad app for Huawei](https://appgallery.huawei.com/#/app/C104163115)

###### Copyright © 2020-2021 DATA MOTION PTE. LTD. All rights reserved.