SDK for Android Developer's Guide

Offline Search

When internet connectivity is unavailable, HERE Places supports offline search by providing results using available cached map data. The search results in this offline mode may be limited.

The main differences compared to online search results are:

  • Fewer POIs (Point of Interests) are available
  • No detailed POI information is available (for example: ratings, reviews, editorials, images, and so on)

Force Online or Offline

You can launch online or offline search without changing the device or HERE SDK connectivity by using setConnectivity(Connectivity) method on a Request instance. This property is applicable to all Request subclasses.

Connectivity has three possible values:
  • If you launch a request using the DEFAULT connectivity mode, the request is performed according to the MapEngine connectivity setting. If the device is offline while MapEngine is set to online mode, the request fails.
  • If you launch a request using the ONLINE connectivity mode, an online request is performed regardless of the MapEngine connectivity setting.
  • If you launch a request using the OFFLINE connectivity mode, an offline request is performed regardless of the MapEngine connectivity setting.
In all cases if the request fails, no fallback action is automatically performed.

To ensure that the connectivity mode is applied, call setConnectivity(Connectivity) before executing a Request.

  • If a Connectivity.ONLINE search request fails due to connection issues, HERE SDK returns the ErrorCode.UNKNOWN error code.
  • If a Connectivity.ONLINE Geocoding or Reverse Geocoding request fails due to connection issues, HERE SDK returns the ErrorCode.NETWORK_COMMUNICATION error code.
  • If a Connectivity.OFFLINE search request fails due to not enough cached data, HERE SDK returns with zero results.