HERE SDK for Android (Premium Edition)
SDK for Android Developer's Guide

You can find an example that demonstrates this feature at https://github.com/heremaps/.

The passive approach is where you allow the SDK to download map data as needed. A typical example is when a user pans the map and triggers an on-demand map data download to render the map.

Map data downloaded in this way is stored in a persistent cache with a default size of 256 MB. Cached map data can be used for offline operations, in cases where a network connection is not available or not desired, such as when the device is in roaming mode. However, there is no way for you to know if sufficient data has been downloaded to enable all offline operations, such as offline search or routing.

Note: To ensure the map data version retrieved by passive approach is the latest available, use the MapLoader APIs to update to the latest version.
Note: Use ApplicationContext.setDiskCacheSize(long) to change the default disk cache size.

HERE SDK provides two alternatives to actively fetch map data:

• Map data may be downloaded in the form of map packages for a predefined region or country
• Map data may be downloaded for an arbitrary bounding box or a radius around a route

The first active approach is where you request the download of map data packages which cover an entire country or region using the MapLoader APIs. You do this by selecting from a list of map packages. A map package may be a state (such as California), region, or a country (such as Belgium).

Note: This preloaded map data is stored separately from the map data cache mentioned in the passive download approach above. The amount of space available for map data packages is only limited by the amount of free space on the device.

The second active approach is where you explicitly trigger a fetch of map data through the MapDataPrefetcher APIs by specifying a bounding box or a radius around a route. The resulting downloaded map data is stored in the same cache used in the passive download approach, where the cache size by default is 256 MB. The SDK does not place a limit on the size of the area requested for download, but it is expected developers are aware of this cache limit and only request areas that result in map data download size of under this limit. You can get a size estimate of the map data that will be downloaded via the MapDataPrefetcher APIs.

To illustrate how much data may be downloaded, consider a bounding box covering an area of 200 km by 200 km in New York City as illustrated in the following screenshot. In this case, approximately 250 MB of map data is downloaded.

The next example shows a 160 km route from New York to Philadelphia with a radius (route corridor width) of 500 m. The map data downloaded is about 100 MB.

Passive Approach Active Approach
On-demand Map Packages Bounding Box / Route
Downloaded map data can be used for offline operation Limited (1) Yes Yes
Size of map data downloads Medium (10s of MBs) Large (100s of MBs) Medium (10s of MBs)
Upper size limit of cache where data is stored (2) 256 MB - 2 GB (2) None (3) 256 MB - 2 GB (2)
Option to check areas for which map data has previously been downloaded (4) No Yes No
• (2): The default value of disk cache upper limit is 256 MB. To change the upper limit of disk cache size use ApplicationContext.setDiskCacheSize(long) method.
• (5): Only option is to completely clear the cache using MapDataPrefetcher APIs, thus removing all map data that was downloaded on demand and map data downloaded by specifying a bounding box or route. Downloaded map packages are not removed.