HERE Android SDK Developer's Guide

CLE2DataManager

The class CLE2DataManager is a member of com.here.android.mpa.customlocation2 .

Class Summary

public class CLE2DataManager

extends java.lang.Object

This class is responsible for managing layer data for CLE2 offline use.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in CLE2DataManager
Nested Classes

public static abstract interface CLE2DataManager.CLE2DownloadListener

Represents a listener that reports information about the completion of a custom location search CLE2Request.

Method Summary

Table 2. Methods in CLE2DataManager
Methods

public boolean cancelAllLayerDowloads ()

Attempts to cancel execution of all ongoing downloads.

public boolean cancelDownload (String layerName)

Attempts to cancel execution of a specific layer download.

public boolean deleteAll ()

Removes all data from the local storage.

public boolean deleteLayer (String layerName)

Delete one specific layer from the local storage.

public void downloadLayer (String layerName, CLE2DownloadListener listener)

Request the full download of a specific layer if layer doesn't exist locally and layer is not updated with server data.

public boolean equals (Object other)

For documentation, see java.lang.Object

public static CLE2DataManager getInstance ()

Returns the CLE2DataManager singleton instance.

public int getNumberOfStoredGeometries (String layerName)

Get the number of geometries stored of a given layer.

public int hashCode ()

For documentation, see java.lang.Object

Class Details

This class is responsible for managing layer data for CLE2 offline use. To download a full layer, call downloadLayer(String, CLE2DataManager.CLE2DownloadListener). To store a subset of geometries, create a CLE2Request and setCachingEnabled(boolean) to true.

Method Details

public boolean cancelAllLayerDowloads ()

Attempts to cancel execution of all ongoing downloads. This attempt will fail if the task has already completed, already been cancelled, or could not be cancelled for some other reason. This call does not guarantee that any download task will be cancelled. For the end result, inspect CLE2ErrorCode value obtained from CLE2Error object passed to the listener.

Returns:

true if there was at least one outstanding download task for which cancellation will be attempted; false otherwise

public boolean cancelDownload (String layerName)

Attempts to cancel execution of a specific layer download. This attempt will fail if the task has already completed, already been cancelled, or could not be cancelled for some other reason. This call does not guarantee that the download job will be cancelled. For the end result, inspect CLE2ErrorCode value obtained from CLE2Error object passed to the listener.

Parameters:

  • layerName

    Name of the layer specifying which download should stop.

Returns:

true if there was a download task for specified layer for which cancellation will be attempted; false otherwise

public boolean deleteAll ()

Removes all data from the local storage.

public boolean deleteLayer (String layerName)

Delete one specific layer from the local storage.

Parameters:

  • layerName

    - layer name to remove from cache

Returns:

- true if operation successful otherwise false.

public void downloadLayer (String layerName, CLE2DownloadListener listener)

Request the full download of a specific layer if layer doesn't exist locally and layer is not updated with server data.

Please note that this method will make two request. One for checking updates and another for downloading. If local stored data is upto date with server data, no downloading will happen.

Parameters:

  • layerName

    layer name to download

  • listener

    listener to notify result of operation.

public boolean equals (Object other)

For documentation, see java.lang.Object

Parameters:

  • other

public static CLE2DataManager getInstance ()

Returns the CLE2DataManager singleton instance.

Returns:

CLE2LayerDownloader instance.

public int getNumberOfStoredGeometries (String layerName)

Get the number of geometries stored of a given layer.

Parameters:

  • layerName

Returns:

number of geometries stored for a given layer.

public int hashCode ()

For documentation, see java.lang.Object

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.