downloadRegions abstract method

MapDownloaderTask downloadRegions(
  1. List<RegionId> regions,
  2. DownloadRegionsStatusListener statusListener
)

Performs an asynchronous request to download map data for regions specified by a list of RegionId instances.

MapDownloader.downloadRegions.statusListener receives notifications until DownloadRegionsStatusListener.onDownloadRegionsComplete is called. The returned MapDownloaderTask can be used to pause or resume the download using MapDownloaderTask.pauseWithCompaction or MapDownloaderTask.resume.

To cancel the request, call MapDownloaderTask.cancel on the returned MapDownloaderTask object. After cancellation, DownloadRegionsStatusListener.onDownloadRegionsComplete is called with the error MapLoaderError.operationCancelled.

MapDownloaderTask remains operational until DownloadRegionsStatusListener.onDownloadRegionsComplete is called.

To get list of downloadable regions use MapDownloader.getDownloadableRegionsWithLanguageCode API.

Simultaneous downloads of the same region are not supported. If this occurs, DownloadRegionsStatusListener.onDownloadRegionsComplete is called with MapLoaderError.serviceAccessFailed for the new request, while the previous one continues uninterrupted.

If indexing is enabled through OfflineSearchEngine.setIndexOptions, then after the requested regions have been downloaded, the corresponding index will be created. The index is used by OfflineSearchEngine to find better results. Note: Indexing is a beta feature, so there could be a few bugs and unexpected behaviors.

To control list of map content features for region download, use LayerConfiguration.enabledFeatures.


Note: If an application is forcefully closed or crashes during a map download operation, then this method can be called again to resume the download. For example, if a download was interrupted at 60%, then the next call to download the same region will load the remaining 40%.
Note: If a download fails during runtime, then the HERE SDK will automatically retry to download the affected region three times before giving up. A connection will be timed out after one minute.

Returns MapDownloaderTask. Handle that will be used to manipulate the execution of the task, for example, to cancel on ongoing request.

Implementation

MapDownloaderTask downloadRegions(List<RegionId> regions, DownloadRegionsStatusListener statusListener);