HERE Android SDK Developer's Guide

RouteManager

The class RouteManager is a member of com.here.android.mpa.routing .

Class Summary

public class RouteManager

extends java.lang.Object

Represents a manager responsible for calculating a Route from a RoutePlan, with a RouteManager.Listener to monitor calculation progress and trigger appropriate callback methods upon completion.

Deprecated: As of SDK 3.2.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in RouteManager
Nested Classes

public static final enumeration RouteManager.Error

Represents values describing possible route calculation errors.

public static abstract interface RouteManager.Listener

Represents a listener to provide information about RouteManager events.

Constructor Summary

Table 2. Constructors in RouteManager
Constructors

RouteManager ()

Deprecated: As of SDK 3.2.

Default constructor.

Method Summary

Table 3. Methods in RouteManager
Methods

public Error calculateRoute (RoutePlan routePlan, Listener listener)

Deprecated: As of SDK 3.2.

Invokes an asynchronous route calculation.

public void cancel ()

Deprecated: As of SDK 3.2.

Cancels the current route calculation.

public DynamicPenalty getDynamicPenalty ()

Deprecated: As of SDK 3.2.

Get the different penalties which is responsible to change the routing conditions.

public boolean isBusy ()

Deprecated: As of SDK 3.2.

Query whether the RouteManager is currently busy computing a route.

public RouteManager setDynamicPenalty (DynamicPenalty penalty)

Deprecated: As of SDK 3.2.

Sets the dynamic penalty that should be applied to route calculations.Penalties can be applied in the form of restricting roads, areas and setting different traffic modes.

Class Details

Deprecated: As of SDK 3.2.

Use an SDK component which implements the Router interface. For core routing types (Car, Truck, Pedestrian) the appropriate class is CoreRouter. For Public Transit routing the appropriate class is UMRouter.

Represents a manager responsible for calculating a Route from a RoutePlan, with a RouteManager.Listener to monitor calculation progress and trigger appropriate callback methods upon completion.

Before using a RouteManager , an application must set appropriate the HERE developer credentials.

Constructor Details

RouteManager ()

Deprecated: As of SDK 3.2.

Use an SDK component which implements the Router interface. For core routing types (Car, Truck, Pedestrian) the appropriate class is CoreRouter. For Public Transit routing the appropriate class is UMRouter.

Default constructor.

Method Details

public Error calculateRoute (RoutePlan routePlan, Listener listener)

Deprecated: As of SDK 3.2.

Use CoreRouter#calculateRoute .

Invokes an asynchronous route calculation. Upon completion of the request, the Listener will be invoked regardless if the request is completed successfully or not.

Parameters:

  • routePlan

    A RoutePlan used to calculate the route

  • listener

    A Listener for the RouteManager

Returns:

The RouteManager.Error error code, one of:

  • RouteManager.Error#NONE if route calculation is started
  • RouteManager.Error#INVALID_OPERATION if a route calculation could not be started because a calculation is already in progress
  • RouteManager.Error#INVALID_PARAMETERS if any of the input parameters is null or the RoutePlan is invalid
  • All other errors also indicate route calculation could not be started

As of 3.2.2, This method returns RouteManager.Error#INVALID_PARAMETERS and a route will not be calculated if calculating a route with TRACK since calculating a route in track mode is no longer supported. This method returns RouteManager.Error#INVALID_PARAMETERS and a route will not be calculated if calculating a route with PUBLIC_TRANSPORT and routePlan contains more than 2 waypoints.

public void cancel ()

Deprecated: As of SDK 3.2.

Use cancel().

Cancels the current route calculation. Note that this API is asynchronous as it takes some time cancel all underlying operations. {Please use RouteManager#isBusy() to check when the RouteManager is free again. Upon completion of the request, the Listener#onCalculateRouteFinished(Error, List) callback with error code RouteManager.Error#ROUTING_CANCELLED will be invoked.

public DynamicPenalty getDynamicPenalty ()

Deprecated: As of SDK 3.2.

Use getDynamicPenalty()

Get the different penalties which is responsible to change the routing conditions.

Returns:

DynamicPenalty used for route calculation

public boolean isBusy ()

Deprecated: As of SDK 3.2.

Use isBusy().

Query whether the RouteManager is currently busy computing a route.

Returns:

true if a route calculation is ongoing, false otherwise.

public RouteManager setDynamicPenalty (DynamicPenalty penalty)

Deprecated: As of SDK 3.2.

Use setDynamicPenalty(DynamicPenalty)

Sets the dynamic penalty that should be applied to route calculations.Penalties can be applied in the form of restricting roads, areas and setting different traffic modes.

Note: Passing null will set the default penalties.

Parameters:

Returns:

This RouteManager

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.