Manage Downloads

This section lists the methods for managing download tasks by pausing, resuming, canceling, or deleting the regional data. These operations are not atomic i.e. among the two components, map-tiles and route-network, one of them may still succeed even when the combined callback reports an error. Inspect both result objects and refresh observed progress after every operation.

APISuccess resultFields to inspect
pauseRegionOfflineRegionPauseDatarouteRegion.errorCode; mapTileRegion.action
resumeRegionOfflineRegionResumeDatarouteRegion.downloadStatus / errorCode; mapTileRegion.action
cancelRegionOfflineRegionCancelDatarouteRegion.errorCode; mapTileRegion.action
deleteRegionAllDataOfflineRegionDeleteDatarouteRegion.tilesGcDeleted / errorCode; mapTileRegion.action

Every combined result also contains regionId. A route errorCode of “0” means that no native error was reported and a non-zero value is indicative and should be handled together with the callback error and refreshed progress. mapTileRegion.message is human-readable diagnostic text and may change between SDK versions.

Map control actionMeaningApplication response
PAUSEDActive or queued map work was pausedOffer “Resume” download
RESUMED / ENQUEUEDExisting work resumed, or missing work was newly queuedKeep observing progress
CANCELLEDActive or queued map work was cancelledRefresh progress. Downloaded files may remain
DELETEDStored map data was deletedRefresh the installed-region list
ALREADY_IN_PROGRESSNo duplicate work was startedKeep observing the existing task
ALREADY_COMPLETEDThe map package was already completeTreat the map side as ready after progress confirmation
ALREADY_PAUSEDThe task was already pausedKeep the paused UI state
NOT_FOUNDNo queued task or installed map region matchedRefresh catalog/progress and verify regionId

For cancelRegion(), routeRegion.tilesGcDeleted is the number of route-tile blobs removed during cancellation cleanup. For deleteRegionAllData(), it is the number removed by deletion. It is not a remaining-tile count. Cancellation may retain downloaded files, but deletion removes stored route and map data.

Do not delete SDK directories directly.

1
NBNavigation.pauseRegion(
2
regionId,
3
object : NBNavigationTaskCallback<OfflineRegionPauseData> {
4
override fun onSuccess(result: OfflineRegionPauseData?) {
5
if (result == null) return
6
Log.i("OfflineNavigation", "pause routeError=${result.routeRegion.errorCode}, " +
7
"mapAction=${result.mapTileRegion.action}")
8
}
9
10
override fun onError(throwable: Throwable) {
11
Log.e("OfflineNavigation", "pauseRegion failed", throwable)
12
}
13
}
14
)