Table of Contents |
---|
...
Sdk class contains the getRouteNavigator
method providing access to the instance of RouteNavigator. The route navigator instance can be accessed only after the SDK was started.
...
The alternativeRoutes
parameter is a list of alternative routes with the latest traffic applied, which can be used for navigation. Use startNavigatingTheRoute
method to start navigation along one of the alternative routes.
GUIDANCE
Navmii SDK allows you to setup the way the navigation guidance will be provided. It's possible throughout the NavigationManager.getGuidanceSettings
method. You can set the guidance output either to text or switch it off. If you pass GuidanceOutput.TEXT
to the GuidanceSettings.setGuidanceOutput
method, you'll be able to receive String
instances with navigation guidance in NavigationListener.onGuidanceTextReady
method.
Code Block | ||
---|---|---|
| ||
@Override
public void onGuidanceTextReady(String text) {
Log.i("NavigationListener", "onGuidanceTextReady: " + text);
} |
You can also set guidance language via the GuidanceSettings.setLocale
method. To get the list of all languages supported by the SDK use the getSupportedLocales
method.
Code Block | ||
---|---|---|
| ||
// Sets guidance language to American English
GuidanceSettings settings = navigationManager.getGuidanceSettings();
settings.setLocale("en-US"); |
Currently supported languages:
Czech
Danish
English (UK)
English (US)
Finnish
French (France)
German
Italian
Korean
Norwegian
Polish
Portugese (Brazil)
Portugese (Portugal)
Russian
Spanish (Spain)
Swedish
Turkish
Voice guidance
It's also possible to receive voice guidance instructions. To do this, first set the path to the directory containing the voice packs by using the Sdk.ConfigurationSettings.Builder.setVoicePacksPath
method. After initializing the SDK, you can retrieve the list of available voice packs with the GuidanceSettings.getAvailableVoicePacks
method, and select one using GuidanceSettings.setVoicePack
. By passing GuidanceOutput.VOICE_PACK
to the GuidanceSettings.setGuidanceOutput
method, directions will be announced using the chosen voice pack.
Example:
Code Block | ||
---|---|---|
| ||
Sdk.ConfigurationSettings.Builder builder = new Sdk.ConfigurationSettings.Builder();
builder.setVoicePacksPath(new File(context.getFilesDir(), "voices").getPath());
// Initialize the SDK and wait for the initialization process to finish
RouteNavigator routeNavigator = Sdk.getInstance().getRouteNavigator();
GuidanceSettings guidanceSettings = routeNavigator.getGuidanceSettings();
List<VoicePack> voicePacks = guidanceSettings.getAvailableVoicePacks();
if (!voicePacks.isEmpty()) {
guidanceSettings.setVoicePack(value);
guidanceSettings.setGuidanceOutput(GuidanceOutput.VOICE_PACK);
} |