HERE Android SDK Developer's Guide

UMRouter

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

Class Summary

public final class UMRouter

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

extends java.lang.Object

Urban Mobility-specific route calculation executor.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in UMRouter
Nested Classes

public static abstract interface UMRouter.Listener

Represents a listener to provide information about route calculation events.

public static final enumeration UMRouter.SubsequentRouteType

Defines if earlier or later routes should be requested.

Constructor Summary

Table 2. Constructors in UMRouter
Constructors

UMRouter ()

Default constructor.

Method Summary

Table 3. Methods in UMRouter
Methods

public void calculateRoute (RoutePlan routePlan, Listener<UMCalculateResult, ErrorCode> listener)

Invokes an asynchronous route calculation.

public void calculateSubsequentRoute (UMCalculateResult result, SubsequentRouteType type, int routeCount, Listener<UMCalculateResult, ErrorCode> listener)

Invokes subsequent route calculation with respect to given UMCalculateResult.

public void cancel ()

public boolean isBusy ()

Class Details

Urban Mobility-specific route calculation executor. Defines Urban Mobility specific calculation methods and response listener.

Urban Mobility provides Inter-modal and Multi-modal routes including Public Transit.

To use this feature, your application must include the google-gson library (release 2.2.4 or a compatible version) on its class path. This library can be downloaded from the google-gson project website at http://code.google.com/p/google-gson/. Attempting to use this feature without adding this library will cause INVALID_OPERATION.

IMPORTANT: Urban Mobility routing is a Beta feature. The related classes are subject to change without notice.

Constructor Details

UMRouter ()

Default constructor. Multiple UMRouter s can be created to calculate multiple routes in parallel.

Method Details

public void calculateRoute (RoutePlan routePlan, Listener<UMCalculateResult, ErrorCode> 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

    A RoutePlan used to calculate the route. NOTE: Urban Mobility supports only 2 waypoints. If RoutePlan contains more than 2 waypoints, error INVALID_PARAMETERS is returned.

  • listener

    A Listener for the UMRouter

public void calculateSubsequentRoute (UMCalculateResult result, SubsequentRouteType type, int routeCount, Listener<UMCalculateResult, ErrorCode> listener)

Invokes subsequent route calculation with respect to given UMCalculateResult. Upon completion of the request, the Listener will be invoked regardless if the request is completed successfully or not.

The UMCalculateResult stores all of the state necessary to perform the subsequent route request (e.g. the RoutePlan ). No state is stored in the UMRouter instance. Therefore it is not required to use the same UMRouter instance to perform the initial request and subsequent request. Because of this, it is possible to issue multiple subsequent route requests in parallel by creating multiple instances of UMRouter .

NOTE: Do not enable strict route count if you plan to use subsequent route requests. See setStrictRouteCountEnabled(boolean) for more details.

Parameters:

  • result

    UMCalculateResult for which subsequent route should be calculated.

  • type

    Type of subsequent route.

  • routeCount

    Number of desired route. Given number is just suggestion and the number of route returned is not guaranteed. Allowed range is [1, 6]. Using unsupported value will result error response in route calculation.

  • listener

    A Listener for the UMRouter.

public void cancel ()

public boolean isBusy ()

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.