HERE Android SDK Developer's Guide

Toll Cost Extension

Toll Cost Extension provides you the possibility to easily access Toll Cost Extension API from the HERE SDK. The HERE Toll Cost Extension (TCE) allows you to determine the toll costs for a specified route for a defined vehicle profile.

TCE Classes

Class Description
TollCostOptions Specify all input parameters of TollCostRequest which includes vehicle profile currency and departure date.
TollCostRequest Allows you to determine the toll costs for a specified route for a defined vehicle profile.
TollCostResult Represents a result from a TCE request.
TollCostVehicleProfile Specify different vehicle parameters and optional input parameters.

Requesting the Toll Cost Data

To use Toll Cost Extension, you need to first have a route calculated in online mode, as the Toll Cost Extension requires permanent directed link IDs. After having a route from the core router, you can then retrieve the toll cost of the route.

// Create the core router
CoreRouter router = new CoreRouter();

// We need link IDs, Route.getPermanentLinkIds(), so we force online routing

You can provide options for the toll cost request through an instance of TollCostOptions. If the vehicle needs non-default settings, such as if this toll request is for a specific type of vehicle, create an TollCostVehicleProfile object.

Note: It is your responsibility to provide a compatible route and toll cost options. When setting the toll cost options, make sure that they match the route options. For example, if the toll cost option vehicle type is set as truck, but the route is created for a car, they are incompatible. In this case, the toll cost result may not be valid.

Next, create a TollCostRequest request object. If the request object is valid and the route contains permanent directed linkids, then you can execute the toll cost request via a result listener. When the result is received, first it is checked for any error. If there is no error, its toll cost contents are retrieved.

Figure 1. A Toll Cost Example
// Step 1: Provide input and calculate toll cost.
Route route = null;   // Required
Date departureTime = null; // Optional

// Step 2: Wrap all input.
// Vehicle profile -> Type Bus, EmissionType EURO_IV, TrailerType NONE. Optional.
TollCostVehicleProfile vehicleProfile = new TollCostVehicleProfile();

TollCostOptions options = new TollCostOptions();

// Step 3: Create request
TollCostRequest request = new TollCostRequest(route, parameter); // request created, can not be modify.

// Step 4: Execute with result listener
request.execute(new TollCostRequest.Listener<TollCostResult>() {
  public void onComplete(TollCostResult result, TollCostError error) {
    // Step 5: process result
    if(error.getErrorCode() != TollCostError.ErrorCode.SUCCESS) {
      // what is the error?

    // if success

    // get total toll cost of a route

    // get toll cost by country
    java.util.Map<String, Double> tollCostByCountry = result.getTollCostByCountry();

    // get toll cost by toll system name
    java.util.Map<String, Double> tollCostByTollSystem = result.getTollCostByTollSystemName();

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