user2316075 user2316075 - 1 month ago 12
Android Question

HERE Android SDK Turn by turn instruction

I am using HERE Android SDK to perform turn by turn navigation project. But I do not get the result similar to image.

enter image description here

I hava this code to get the current manauver

private NavigationManager.NewInstructionEventListener newInstructionEventListener = new NavigationManager.NewInstructionEventListener() {
@Override
public void onNewInstructionEvent() {
Maneuver maneuver = navigationManager.getNextManeuver();

if (maneuver != null) {
if (maneuver.getAction() == Maneuver.Action.END) {

}

tvManeuver.setText(navigationManager.getNextManeuver().getTurn().name() + " " + maneuver.getIcon().value());
ivTitle.setImageBitmap(maneuver.getNextRoadImage().getBitmap());
tvStreet.setText(maneuver.getRoadName());
tvMeters.setText("durante " + maneuver.getDistanceFromPreviousManeuver() + " m");

if (maneuver.getDistanceToNextManeuver() == 0) {
tvMeters.setVisibility(View.GONE);
} else {
tvMeters.setVisibility(View.VISIBLE);
}
}
}
};


But I do not get the correct text of the maneuver. For example "Turn right at the next corner" and the and the corresponding arrow icon to put inside IMAGEVIEW.

can anybody help me?

Regards.

Answer

I assume the image you provided is from HERE Maps available on Google Store which is a custom implementation using the HERE SDK.

The instruction you can get from Maneuver , check documentation https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics_api_nlp_hybrid_plus/com-here-android-mpa-routing-maneuver.html#topic-apiref__getinstruction-void

Icon should also be retrieved from getIcon() , which gives an enumeration and you will need to create images for possible enumerations in the icon , check documentation https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics_api_nlp_hybrid_plus/com-here-android-mpa-routing-maneuver-icon.html#topic-apiref

Comments