HERE Android SDK Developer's Guide

Embedding the Map Service

Map Service is an Android service that facilitates the use of a shared disk cache among applications that use the HERE SDK. This service must be embedded and deployed with your HERE-enabled application; otherwise, the MISSING_SERVICE error code is returned via the onEngineInitializationCompleted() callback.

To embed Map Service, add the following lines inside the <application></application> section in your AndroidManifest.xml file:
<service
  android:name="com.here.android.mpa.service.MapService"
  android:label="HereMapService"
  android:process="global.Here.Map.Service.v2"
  android:exported="true" >
  <intent-filter>
    <action android:name="com.here.android.mpa.service.MapService" >
    </action>
  </intent-filter>
</service>

Using an Isolated Map Disk Cache with the Map Service

The HERE SDK supports an isolated disk cache. This allows you to set the disk cache to another location, such as an SD Card.

Note:
  • This feature is considered experimental, and migrating the disk cache contents from one location to another is not supported. If you are using an SD card, ensure the SD card is always present to avoid any unexpected behavior.
  • You should only delete the map data cache when the app is in its early start-up stages, before any HERE SDK calls. Otherwise, map data corruption and unexpected app errors can occur.

The first step to use an isolated disk cache is to edit the AndroidManifest.xml with the following, providing the service label and intent name with your custom values.

<service
  android:name="com.here.android.mpa.service.MapService"
  android:label="{YOUR_LABEL_NAME}"
  android:exported="false" >
  <intent-filter>
    <action android:name="{YOUR_INTENT_NAME}" >
    </action>
  </intent-filter>
</service>
Note: Always provide custom values for {YOUR_LABEL_NAME} and {YOUR_INTENT_NAME} when you are using an isolated disk cache. Do not reuse the HERE SDK defaults.

After editing AndroidManifest.xml, add a call to MapSettings.setIsolatedDiskCacheRootPath(String path, String intent) with the desired cache location and the custom intent name. This call should occur before MapEngine initialization. For example, if you are modifying the application from the sample tutorial app, you can add the call in the BasicMapActivity.java file before mapFragment.init().

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  // Search for the map fragment to finish setup by calling init().
  mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.mapfragment);
  com.here.android.mpa.common.MapSettings.setIsolatedDiskCacheRootPath(
      "/sdcard/foo/myservice"
      , "{YOUR_INTENT_NAME}");
  mapFragment.init(new OnEngineInitListener() {
  ...

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.