> For the complete documentation index, see [llms.txt](https://docs.drivequant.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.drivequant.com/get-started-drivekit/android/references.md).

# References

## DriveKitListener <a href="#drivekitlistener" id="drivekitlistener"></a>

DriveKitListener is an interface that can be passed as a parameter during the DriveKit Core module [initialization](https://docs.drivequant.com/get-started-drivekit/android#drivekit-initialization). It gives useful events about the user lifecycle.

```kotlin
interface DriveKitListener {
    fun onConnected()
    fun onDisconnected()
    fun onAuthenticationError(errorType: RequestError)
    fun userIdUpdateStatus(status: UpdateUserIdStatus, userId:String?)
    fun onAccountDeleted(status: DeleteAccountStatus)
}
```

| Method                                                           | Description                                                                                                 |
| ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `onConnected()`                                                  | The user has been successfully logged                                                                       |
| `onDisconnected()`                                               | The user has been disconnected (manual logout or the account is disabled/deleted)                           |
| `onAuthenticationError(errorType: RequestError)`                 | The login has failed due to a [`RequestError`](#deviceconfigevent)                                          |
| `userIdUpdateStatus(status: UpdateUserIdStatus, userId:String?)` | The update userId request has been processed with a [`UpdateUserIdStatus`](#updateuseridstatus) state value |
| `onAccountDeleted(status: DeleteAccountStatus)`                  | The delete account request has been processed with a `DeleteAccountStatus` state value                      |

## UpdateUserIdStatus

`UpdateUserIdStatus` is an enum that explains the request status after a userId has asked to be changed.

```kotlin
enum class UpdateUserIdStatus {
    UPDATED, FAILED_TO_UPDATE, INVALID_USER_ID, ALREADY_USED, SAVED_FOR_REPOST
}
```

| Value              | Description                                                                                |
| ------------------ | ------------------------------------------------------------------------------------------ |
| `UPDATED`          | The userId has been successfully updated                                                   |
| `FAILED_TO_UPDATE` | Occurs when DriveKit is not configured yet or if the new userId is the same as the old one |
| `INVALID_USER_ID`  | Error returned when the new userId is blank                                                |
| `ALREADY_USED`     | The new userId is already taken by another user                                            |
| `SAVED_FOR_REPOST` | The request failed but a retry will be done                                                |

## RequestError <a href="#deviceconfigevent" id="deviceconfigevent"></a>

`RequestError` is an enum that describes the error type of a DriveKit request.

```kotlin
enum class RequestError {
    NO_NETWORK, UNAUTHENTICATED, FORBIDDEN, SERVER_ERROR, CLIENT_ERROR, UNKNOWN_ERROR, LIMIT_REACHED
}
```

| Value             | Description                                                                                                          |
| ----------------- | -------------------------------------------------------------------------------------------------------------------- |
| `NO_NETWORK`      | The user has no or a bad connection during the request.                                                              |
| `UNAUTHENTICATED` | A request has been launched but the user is not logged (401 error).                                                  |
| `FORBIDDEN`       | A 403 error occurred. You might don't have access to call that service. Please contact the DriveQuant to learn more. |
| `SERVER_ERROR`    | Drivequant's backend responds with a 500 server error.                                                               |
| `CLIENT_ERROR`    | Drivequant's backend responds with a 400 error different than `UNAUTHENTICATED`, `FORBIDDEN` and `LIMIT_REACHED`     |
| `UNKNOWN_ERROR`   | An unknown error occurred, please contact the Drivequant team to investigate the issue.                              |
| `LIMIT_REACHED`   | The DriveKit API key has reached the accounts number limit. Please contact the Drivequant team.                      |

## DeleteAccountStatus

`DeleteAccountStatus` is an enum that describes the deletion status. It can have 3 values:&#x20;

* `SUCCESS`: Account deleted successfully&#x20;
* `FAILED_TO_DELETE`: Account not deleted, an error has occurred&#x20;
* `FORBIDDEN`: Account deletion not activated for this team

## DKWeather

`DKWeather` is an enum that describe each category of weather during a trip. It can have these values:

* `UNKNOWN`
* `SUN`
* `CLOUD`
* `FOG`
* `RAIN`
* `SNOW`
* `ICE`

## DKPeriod

`DKPeriod` indicates the aggregation size of each timeline object. It is an enum with the following values:

<table><thead><tr><th width="175.5">Value</th><th>Description</th></tr></thead><tbody><tr><td>WEEK</td><td>Timeline data is aggregated week by week</td></tr><tr><td>MONTH</td><td>Timeline data is aggregated month by month</td></tr><tr><td>YEAR</td><td>Timeline data is aggregated year by year</td></tr></tbody></table>

## RoadContext

`RoadContext` indicates the kind of roads where the data was gathered. It is an enum with the following values:

<table><thead><tr><th width="286">Value</th><th>Description</th></tr></thead><tbody><tr><td>TRAFFIC_JAM</td><td>The targeted driver was in traffic jams</td></tr><tr><td>HEAVY_URBAN_TRAFFIC</td><td>The targeted driver was in dense city roads</td></tr><tr><td>CITY</td><td>The targeted driver was in light traffic city roads</td></tr><tr><td>SUBURBAN</td><td>The targeted driver was in suburban or countryside roads</td></tr><tr><td>EXPRESSWAYS</td><td>The targeted driver was in express ways</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.drivequant.com/get-started-drivekit/android/references.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
