> For the complete documentation index, see [llms.txt](https://docs.artificient.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.artificient.de/usage/android/listeners.md).

# Listeners

To keep developers using the GIZO SDK informed about the status of the services within the SDK, the following listeners have been provided:

## Retrieving the Last Location

To get the last GPS location returned by the device, the following listener can be used:

```kotlin
gizoAnalysis.didUpdateLocation = { location ->
    Log.d("tag", "Latitude: ${location?.latitude}, Longitude: ${location?.longitude}, Timestamp: ${location?.time}")
}
```

## Start of a Recording

The listener below notifies you when a new recording starts, whether triggered automatically or manually.

```kotlin
gizoAnalysis.didStartRecording = {
    Log.d("tag", "Recording started")
}
```

## End of a Recording

The listener below notifies you when a new recording stops, regardless of whether it is terminated automatically or manually.

```kotlin
gizoAnalysis.didStopRecording = {
    Log.d("tag", "Recording stopped")
}
```

## Start of Upload to GIZO Platform

The listener below informs you about the initiation of the process for uploading the recorded trips to the GIZO platform.

```kotlin
gizoAnalysis.onStartUploadTrip = { tripId ->
    Log.d("tag", "onStartUploadTrip ${tripId}");
}
```

## End of Upload to GIZO Platform

The listener below informs you about the end of the upload process once the trip data has been successfully uploaded to the GIZO platform.

```kotlin
gizoAnalysis.onCompleteUploadTrip = { tripId ->
    Log.d("tag", "onCompleteUploadTrip ${tripId}");
}
```

## Detection of a Crash

Once a crash is detected, the following listener provides some preliminary information on the accident.

```kotlin
gizoAnalysis.onDetectedCrash = { crashDetected -> 
    Log.d("CrashDetected", """
        time=${crashDetected.time}, lat=${crashDetected.lat}, lon=${crashDetected.lon},
        speed=${crashDetected.speed}, accel=${crashDetected.accel}, severity=${crashDetected.severity},
        uniqueid=${crashDetected.uniqueid}
    """.trimIndent())
}
```

## End of Upload of a Crash of to the GIZO Platform

The following listener returns an event once a detected crash is uploaded.

```kotlin
gizoAnalysis.onUploadedCrash = { crashUploaded -> 
    Log.d("CrashDetected", """
        id=${crashDetected.id}, time=${crashDetected.time}, lat=${crashDetected.lat}, lon=${crashDetected.lon},
        speed=${crashDetected.speed}, accel=${crashDetected.accel}, severity=${crashDetected.severity},
        uniqueid=${crashDetected.uniqueid}
    """.trimIndent())
}
```
