# Query Installed Regions

This guide describes how to read installed offline regions from the SDK, inspect local metadata, and use worker-thread reads when the app needs a complete on-disk snapshot after launch.

When a cold start requires a reliable read of the on-disk manifest, call the following on an IO thread:

```kotlin
lifecycleScope.launch {
    val installed = withContext(Dispatchers.IO) {
        RegionalOffline.listInstalledRegions()
    }
    renderInstalled(installed)
}
```

_OfflineInstalledRegion_'s commonly used fields:

| Field | Purpose |
| --- | --- |
| `regionId`, `displayName` | Local list and subsequent control |
| `packageCount` | Number of installed packages |
| `totalBytes` | Bytes of installed databases recorded in the manifest |
| `regionVersion` | Compare with the online catalog to detect updates |
| `allTarsOk` | Whether all region packages were installed successfully |
| `dataSource` | Tile server that owns the installed data |

Other local APIs:

```kotlin
val hasAnyRegion = withContext(Dispatchers.IO) {
    RegionalOffline.hasInstalledOfflineRegions()
}

val localDetail = withContext(Dispatchers.IO) {
    RegionalOffline.loadOfflineDetail(regionId)
}

val queuedTask = RegionalOffline.queueRecordFor(regionId)
```

When _hasInstalledOfflineRegions()_ or _listInstalledRegions()_ is called on the main thread, the SDK returns only the already loaded, non-blocking snapshot. Switch to a worker thread when a cold start requires the complete on-disk result.
