When internet connectivity is unavailable, the 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's information is available (for example: ratings, reviews, editorials, images, and so on)
Force Online or Offline
You can launch online or offline searches without changing the device or HERE SDK connectivity by using the
setConnectivity(Connectivity) method on a
Request instance. This property is applicable to all
Request subclasses, except
TextAutoSuggestionRequest, which can only be used online.
Connectivityhas three possible values:
DEFAULT- Uses the connectivity as determined through the SDK
OFFLINE- Uses cached data on the device
ONLINE- Attempts to perform online requests, but does not fallback to use cached data even if no connection is available
To ensure that the connectivity mode is applied,
setConnectivity(Connectivity) before executing a
- If a
Connectivity.ONLINEsearch request fails due to connection issues, HERE SDK returns the
- If a
Connectivity.ONLINEGeocoding or Reverse Geocoding request fails due to connection issues, HERE SDK returns the
- If a
Connectivity.OFFLINEsearch request fails due to not enough cached data, HERE SDK returns with zero results.
- If you attempt to execute a
Connectivity.OFFLINEconnectivity mode, HERE SDK returns the
ErrorCode.SERVICE_UNAVAILABLEerror code, since auto suggestions are only supported online.