# DownloadCallback

# DownloadCallback


```
interface DownloadCallback
```

<br />

*** ** * ** ***

Callback functions used for feature downloading.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/DownloadCallback#onDownloadCompleted()()` Called when the feature download is completed. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/DownloadCallback#onDownloadFailed(com.google.mlkit.genai.common.GenAiException)(e: https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/GenAiException)` Called when the feature download failed. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/DownloadCallback#onDownloadProgress(long)(totalBytesDownloaded: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Called when the feature download is in progress. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developers.google.com/android/reference/kotlin/com/google/mlkit/genai/common/DownloadCallback#onDownloadStarted(long)(bytesToDownload: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Called when the feature download started properly. |

## Public functions

### onDownloadCompleted

```
fun onDownloadCompleted(): Unit
```

Called when the feature download is completed.

### onDownloadFailed

```
fun onDownloadFailed(e: GenAiException): Unit
```

Called when the feature download failed.

### onDownloadProgress

```
fun onDownloadProgress(totalBytesDownloaded: Long): Unit
```

Called when the feature download is in progress.

### onDownloadStarted

```
fun onDownloadStarted(bytesToDownload: Long): Unit
```

Called when the feature download started properly.