updateCatalog abstract method
- CatalogUpdateInfo catalogInfo,
- CatalogUpdateProgressListener callback
Performs an asynchronous request for each catalog to update map data to the latest available version.
This applies to all previously installed Region map data and any incomplete downloads in a pending state.
If no regions are downloaded, this method updates only the map version. The map cache and persisted regions are always bound to the same map version.
If no updates are available, CatalogsUpdateInfoCallback from MapUpdater.retrieveCatalogsUpdateInfo returns an empty list. In this case, MapUpdateProgressListener.onComplete is called immediately.
To check for available updates, use MapUpdater.retrieveCatalogsUpdateInfo to retrieve catalogs with newer versions. Individual catalogs can then be updated using this method. Ensure that the device has enough free disk space to perform a catalog update. Information about the required disk space is available in CatalogUpdateInfo.diskSizeInBytes.
If there is not enough space to perform the catalog update with the default MapUpdaterMapUpdateVersionCommitPolicy.onComplete, try using MapUpdaterMapUpdateVersionCommitPolicy.onFirstRegion. This option requires less space but follows a different strategy for handling errors during the map update.
If indexing is enabled through OfflineSearchEngine.setIndexOptions, the index is rebuilt after the map is updated.
The index helps OfflineSearchEngine provide better search results.
Note: Indexing is a beta feature and may have bugs or unexpected behavior.
-
catalogInfocatalog to update. CatalogUpdateInfo should be get from MapUpdater.retrieveCatalogsUpdateInfo -
callbackCallback which receives the result on the main thread.
Returns CatalogUpdateTask. A handle that will be used to manipulate the execution of the task, for example, to cancel an ongoing request.
Implementation
CatalogUpdateTask updateCatalog(CatalogUpdateInfo catalogInfo, CatalogUpdateProgressListener callback);