How to change distance metric for Google Navigation SDK voice guidance on Android Auto?

5 days ago 4
ARTICLE AD BOX

See class StepInfo.

There's just getDistanceFromPrevStepMeters() and getTimeFromPrevStepSeconds()

and there's getFullInstructionText(). Internally these values all seem to be metric.

This is being called "Units of measurement" ...or LocaleData.MeasurementSystem


You'd need your own StepInfo.Builder, which provides an alternate class StepInfo, which overides the getters, eg. where getFullInstructionText() would have to return values from the imperial system, or some additional method getDistanceFromPrevStepFeet(). The string from getFullInstructionText() seems to be the string used in voice guidance - and StepInfo.Builder has the corresponding setter. It's just strange, that in screenshots, miles are being displayed: https://developer.android.com/training/cars/apps/navigation

Once can as well disable default cards (eg. ETA) and display a custom card instead: https://developers.google.com/maps/documentation/navigation/android-sdk/faq#ui-customization_1

Any languages supported by Google Maps Mobile are automatically available for the Navigation SDK. A device has a default system language and an app cannot change that setting; however, the app has access to over 70 languages.

One probably has to package these ressources, to begin with ....

android { defaultConfig { // Set this to the languages you actually use, otherwise you'll include // resource strings for all languages supported by the Navigation SDK. resConfigs "en" } }

Class Distance would permit to set a measurement unit.

Martin Zeitler's user avatar

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Read Entire Article