I am trying to use the HERE SDK Explorer Edition for Android and I need to make an API call to the HERE routes API. The API call itself works in the web browser, but I get "Routing error: 1, exception: Requested resource not found, error code: 404" when trying to use it in the Android application.
The API call is: "https://router.hereapi.com/v8/routes?apikey=-YOUR_API_KEY&origin=52.524465%2C13.382334&destination=52.525301%2C13.399844&return=polyline%2Csummary%2Cactions%2Cinstructions%2CrouteHandle&transportMode=car"
as shown in the documentation: "https://developer.here.com/documentation/android-sdk-explore/4.13.5.0/dev_guide/topics/routing.html#import-routes-from-other-services"
The code I have tried to use the API in the SDK is as follows:
routingEngine.importRoute(
new RouteHandle(apiCall),
new RefreshRouteOptions(TransportMode.CAR),
new CalculateRouteCallback() {
@Override
public void onRouteCalculated(@Nullable RoutingError routingError, @Nullable List<Route> routes) {
if (routingError == null) {
Route route = routes.get(0);
showRouteDetails(route);
showRouteOnMap(route);
getManeuverInstructions(route);
logRouteViolations(route);
} else {
Log.e("Error while calculating a route:", routingError.toString());
}
}
}
);