# Monitor Download Progress

This guide explains how to monitor download progress to track route-network, map-tile, and overall region’s state. Subsequently, it explains how to use these states to decide when offline routing, offline map display, or the complete offline navigation experience is available.

```kotlin
private fun renderDownloadProgress(items: List<OfflineRegionProgress>) {
    items.forEach { progress ->
        val routeReady =
            progress.routeNetwork?.state == OfflineTaskState.COMPLETED
        val mapReady =
            progress.mapTile?.state == OfflineTaskState.COMPLETED

        updateRegionRow(
            regionId = progress.regionId,
            percent = progress.overallPercent.coerceIn(0, 100),
            state = progress.overallState,
            routeReady = routeReady,
            mapReady = mapReady
        )
    }
}
```

| State | Recommended UI |
| --- | --- |
| `NOT_STARTED` | Not started |
| `QUEUED` | Waiting to download |
| `RUNNING` | Show the percentage and a downloading state |
| `PAUSED` | Show a paused state and a “Resume” button |
| `PARTIAL` | Show an incomplete state and a “Resume” button |
| `FAILED` | Show the error and a “Retry” button |
| `COMPLETED` | This subtask is complete |

_routeNetwork_ at `COMPLETED` means that offline routing is available while `mapTile` at `COMPLETED` means that the offline basemap is available.

> _Show full offline navigation as available only when both - **routeNetwork** and **mapTile** are complete._

After an application restart, call _initialize()_ and observe progress again to restore persisted state. Do not create another download task because a screen was recreated. Calling _cancel()_ on the subscription handle removes only that screen's listener but it does not cancel the download.
