We did experience some inconsistency from the SKNavigationState updates with Android.
Sometimes we get inconsistent SKNavigationState object after starting navigation, therefore navigation stopped working.
A strange thing is, that sometimes it does work. First we suspected certain builds to be corrupt, but we had some builds where it did work work and did not work when deployed several times even to the same device.
We tried SDK version 2.5.0., 2.5.1 and 3.0.2 in combination with two versions of our code. We had working and not working states with equal version combinations so we don't think this has an influence.
Furthermore we checked the SKAdvisorSettings initialization and the gradle files.
Is this a known problem? Anyone knows how to solve it?
SKAdvisorSettings Initialization:
public void setAdvicesAndStartNavigation(Application application, SKMapSurfaceView skMapSurfaceView) {
[…]
initializeTextToSpeech(application);
final SKAdvisorSettings advisorSettings = new SKAdvisorSettings();
if (application.getResources().getConfiguration().locale.getLanguage().equals(Locale.GERMAN.toString())) {
advisorSettings.setLanguage(SKAdvisorSettings.SKAdvisorLanguage.LANGUAGE_DE);
advisorSettings.setAdvisorVoice("de");
} else if (application.getResources().getConfiguration().locale.getLanguage().equals(Locale.FRENCH.toString())) {
advisorSettings.setLanguage(SKAdvisorSettings.SKAdvisorLanguage.LANGUAGE_FR);
advisorSettings.setAdvisorVoice("fr");
} else if (application.getResources().getConfiguration().locale.getLanguage().equals("es")) {
advisorSettings.setLanguage(SKAdvisorSettings.SKAdvisorLanguage.LANGUAGE_ES);
advisorSettings.setAdvisorVoice("es");
} else {
advisorSettings.setLanguage(SKAdvisorSettings.SKAdvisorLanguage.LANGUAGE_EN);
advisorSettings.setAdvisorVoice("en");
}
advisorSettings.setAdvisorConfigPath([…].getMapResourcesDirPath() + "/Advisor");
advisorSettings.setResourcePath([…].getMapResourcesDirPath() + "/Advisor/Languages");
advisorSettings.setAdvisorType(SKAdvisorSettings.SKAdvisorType.TEXT_TO_SPEECH);
SKRouteManager.getInstance().setAudioAdvisorSettings(advisorSettings);
launchNavigation(application, skMapSurfaceView);
}
Example #1: incorrect distance
SKNavigationState [adviceID=-1,
currentSpeed=0.0,
currentSpeedLimit=0.0,
countryCode=,
lastAdvice=false,
showSignPost=false,
currentAdviceCurrentStreetName=,
currentAdviceNextStreetName=,
currentAdviceCurrentOsmStreetType=UNDEFINED,
currentAdviceNextOsmStreetType=UNDEFINED,
currentAdviceDistanceToAdvice=-1635951600, // <------ incorrect
currentAdviceTimeToDestination=-1636254096,
currentAdviceDistanceToDestination=-1635951952,
currentAdviceVisualAdviceFile=,
currentAdviceAudioAdvices=[None],
currentAdviceExitNumber=,
nextAdviceCurrentStreetName=,
nextAdviceNextStreetName=,
nextAdviceDistanceToAdvice=-1635998000,
nextAdviceVisualAdviceFile=,
nextAdviceCurrentOsmStreetType=UNDEFINED,
nextAdviceNextOsmStreetType=UNDEFINED,
distanceToDestination=0.0,
firstCrossingDescriptor=SKCrossingDescriptor [crossingType=0,
routeAngle=0.0,
turnToRight=false,
directionUK=false,
allowedRoutesAngles=null,
forbiddenRoutesAngles=null],
secondCrossingDescriptor=SKCrossingDescriptor [crossingType=0,
routeAngle=0.0,
turnToRight=false,
directionUK=false,
allowedRoutesAngles=null,
forbiddenRoutesAngles=null],
adviceInstruction=,
viaPointsInfo=null,
isLastVisualAdvice=false,
currentStreetDirection=DIRECTION_INVALID,
nextStreetDirection=DIRECTION_INVALID]
Example #2: distance
SKNavigationState [adviceID=0,
currentSpeed=0.0,
currentSpeedLimit=0.0,
countryCode=DE,
lastAdvice=false,
showSignPost=true,
currentAdviceCurrentStreetName=,
currentAdviceNextStreetName=,
currentAdviceCurrentOsmStreetType=TRACK,
currentAdviceNextOsmStreetType=UNDEFINED,
currentAdviceDistanceToAdvice=130, // <------ correct
currentAdviceTimeToDestination=22,
currentAdviceDistanceToDestination=130,
currentAdviceVisualAdviceFile=/storage/emulated/0/Android/data/[…].debug/files/SKMaps//Advisor/Visual/153844/0.png,
currentAdviceAudioAdvices=[in_open,
130_meters,
you_will_reach_your_destination],
currentAdviceExitNumber=,
nextAdviceCurrentStreetName=,
nextAdviceNextStreetName=,
nextAdviceDistanceToAdvice=-1582944816,
nextAdviceVisualAdviceFile=,
nextAdviceCurrentOsmStreetType=UNDEFINED,
nextAdviceNextOsmStreetType=UNDEFINED,
distanceToDestination=130.0,
firstCrossingDescriptor=SKCrossingDescriptor [crossingType=0,
routeAngle=90.0,
turnToRight=false,
directionUK=false,
allowedRoutesAngles=null,
forbiddenRoutesAngles=null],
secondCrossingDescriptor=SKCrossingDescriptor [crossingType=0,
routeAngle=0.0,
turnToRight=false,
directionUK=false,
allowedRoutesAngles=null,
forbiddenRoutesAngles=null],
adviceInstruction=in 130 meters you will reach your destination,
viaPointsInfo=null]