HERE Android SDK Developer's Guide

CoreRouter

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

Class Summary

public final class CoreRouter

   implements com.here.android.mpa.routing.Router

extends java.lang.Object

Route calculation executor handling core routing types (Car, Truck, Pedestrian).

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in CoreRouter
Nested Classes

public static final enumeration CoreRouter.Connectivity

The possible types of connectivity for route calculation

public static abstract interface CoreRouter.Listener

Represents a listener to provide information about route calculation events.

Constructor Summary

Table 2. Constructors in CoreRouter
Constructors

CoreRouter ()

Default constructor with DEFAULT.

Method Summary

Table 3. Methods in CoreRouter
Methods

public void calculateRoute (RoutePlan routePlan, Listener<RouteResult, RoutingError> listener)

Invokes an asynchronous route calculation.

public void cancel ()

public Connectivity getConnectivity ()

Gets the connectivity to be used for route calculation.

public DynamicPenalty getDynamicPenalty ()

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

public boolean isBusy ()

public CoreRouter setConnectivity (Connectivity connectivity)

Determines whether route is calculated online or offline.

public CoreRouter setDynamicPenalty (DynamicPenalty penalty)

Sets the dynamic penalty that should be applied to route calculations.

Class Details

Route calculation executor handling core routing types (Car, Truck, Pedestrian). Defines concrete calculation method and response listener for core routing types.

Constructor Details

CoreRouter ()

Default constructor with DEFAULT. Multiple CoreRouter s can be created to calculate multiple routes in parallel.

Method Details

public void calculateRoute (RoutePlan routePlan, Listener<RouteResult, RoutingError> listener)

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
  • listener

    A Listener for the CoreRouter As of 3.2.2, This method will notify listeners with 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 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 ()

public Connectivity getConnectivity ()

Gets the connectivity to be used for route calculation.

Returns:

CoreRouter.Connectivity to be used for route calculation

public DynamicPenalty getDynamicPenalty ()

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

Returns:

DynamicPenalty used for route calculation

public boolean isBusy ()

public CoreRouter setConnectivity (Connectivity connectivity)

Determines whether route is calculated online or offline. Default is DEFAULT. If set to offline, it will attempt to calculate the route offline regardless of the routing type and regardless of whether there is enough map data for the route calculation, if fails, it will not make another attempt online. If set to online, it will attempt to calculate the route online regardless of the routing type and regardless of the current device connectivity. If it fails, it will not make another attempt offline. If this is changed after calling calculateRoute, the change will not take effect for the current route calculation. \note An example of the usage is as follows: e.g. An app wishes to try online first and falls back to offline if online fails. Such app will set connectivity to ONLINE before calculating a route, if this fails, it will change connectivity to OFFLINE before another route calculation attempt.

Parameters:

Returns:

This CoreRouter to be used for route calculation

public CoreRouter setDynamicPenalty (DynamicPenalty penalty)

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 CoreRouter

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.