Search code examples
androidskmaps

Is it possible to update the Audio Advice returned in Navigation to use Imperial (miles and feet) units?


When playing out Audio Advice in Navigation mode using the Android SKMaps SDK (v2.5), it is possible to update the Advice before it is output to reflect Imperial/US Standard as opposed to Metric?

Looking at the audio_files that are provided with the SDK, I do see pre-recorded files representing Imperial units, but I can't find a method within the documentation that shows how to update this.

The closest I can find is getAdviceList() which allows you to specify a SKDistanceUnitType to generate the visual advice texts accordingly, however, I don't see anything in SKAdvisorSettings (apologies for the lack of a link, this is a new account which doesn't allow for more than 2 links in a post) which would let me modify how Audio Advice is output.

Does anyone have any insight on how this could be accomplished? Thanks for any help!

-Keith


Solution

  • Upon seeing SylviA's post to this question, I dug a bit more into the getAdviceList() method and noticed that while it called a native function this.setmeasurementunit() to save the distance type passed to the method, this was still not reflecting in the audio and text displayed while in navigation mode.

    The returned List<SKRouteAdvice> object did in fact show units in Imperial, but once navigation started, advice would revert to metric.

    After some time, I found another method within the SKNavigationSettings class called setDistanceUnit which solved my problem.

    SKNavigationSettings navSettings = new SKNavigationSettings();
    navSettings.setDistanceUnit(SKMaps.SKDistanceUnitType.DISTANCE_UNIT_MILES_FEET);
    ...
    navManager.startNavigation(navSettings);
    

    Making that change made sure both the Audio and Text returned in navigation mode used Imperial/US Standard units and I needed.

    Hope that helps, and thanks again to SylviA's post that led me to this realization.