目录

MapNavi

Class Info

public class MapNavi

Navigation API class.

Public Method Summary

Qualifier and Type

Method Name and Description

void

addAttentServerArea(int index)

Adds a favorite service area.

boolean

addMapISAListener(MapISAListener listener)

Adds an ISA listener.

boolean

addMapNaviListener(MapNaviListener listener)

Adds a navigation event listener.

void

batchQuery(BatchQueryRequest request)

Queries routes in batches.

boolean

calculateAccessTypeOfTTS(DeliverConfigReqDTO deliverConfigReqDTO)

Obtains the TTS engine type. Apps can use this method to calculate the access type of TTS.

boolean

calculateBusDriveRoute(BusCqlRequest buscqlreques)

Calculates public transit routes.

boolean

calculateCycleRoute(RoutingRequestParam requestParam)

Calculates cycling routes.

boolean

calculateCyclingGuide()

Calculates cycling guidance.

boolean

calculateDriveGuide()

Calculates driving guidance.

boolean

calculateDriveRoute(RoutingRequestParam driveRequest)

Calculates driving routes.

boolean

calculateRealTimeBusInfo(RealTimeTransitRequest realTimeTransitRequest)

Checks whether real-time transit information is queried successfully.

boolean

calculateWalkGuide()

Calculates walking guidance.

boolean

calculateWalkRoute(RoutingRequestParam requestParam)

Calculates walking routes.

void

cancelBroadInfo(String broadText)

Cancels event point broadcast.

boolean

changeRouteId(int id)

Changes the route to an alternative route.

void

clear()

Clears navigation data, after which the SDK function is still available.

void

clearAllAttentServerArea()

Clears service area information for all routes.

void

clearCurPathAttentServerArea()

Clears service area information for the current route.

void

destroy()

Destroys the navigation object to release resources.

boolean

existAttentServerArea(int index)

Checks whether the service area with the specified index has been added to favorites.

Map<Integer, List<FurnitureInfo>>

getAllAttentServerArea()

Obtains service area information of all routes.

List<String>

getCurPathFullBroadcastTextsRemovePercent()

Obtains all broadcast texts excepting those including placeholders for the current route.

String

getFullScreenNaviVoiceText()

Obtains the broadcast text for full-screen lane-level guidance.

boolean

getFutureEta(FutureEtaOptions options)

Obtains a list of future ETAs.

String

getGpsLostVoiceText()

Obtains the broadcast text for GPS signal loss.

static final MapNavi

getInstance(Context context)

Obtains a MapNavi instance.

String

getJamTTSText()

Obtains the broadcast text for traffic jam.

MapNaviStaticInfo

getMapNaviStaticInfo()

Obtains navigation statistics information.

MapNaviPath

getNaviPath()

Obtains the current route.

HashMap<Integer, MapNaviPath>

getNaviPaths()

Obtains multiple planned routes.

void

getReachableBoundary(NewEnergyRequest request)

(New energy) Obtains the reachable boundary and nearby search result.

String

getSDKVersion()

Obtains the SDK version number.

VehicleType

getVehicleType()

Obtains the navigation engine type.

String

getVoiceByte(VoiceRequest voiceRequest)

Obtains the PCM voice stream converted from the text.

void

initLogSettings(boolean log2FileEnabled, String logFilePath)

Initializes log settings.

OfflineInitErrorCode

initOfflineMode(OfflineDataStateRequest request)

Initializes offline data.

void

initSettings(ClientParas clientParas)

Initializes settings.

void

interruptsBusRequest()

Cancels the request for planning public transit routes.

boolean

isAutoRefreshTrafficInfo()

Checks whether the traffic information is automatically refreshed.

static DayNightMsg

isDayTime(NaviLatLng latLng)

Checks whether the input longitude-latitude location is currently in daytime or at night.

boolean

isDisplayETA()

Checks whether the ETA is displayed.

boolean

isRoutePathSelected(int id)

Checks whether the route with the specified ID is selected.

void

removeAttentServerArea(int index)

Removes a favorite service area.

void

removeMapISAListener(MapISAListener listener)

Removes an ISA listener.

void

removeMapNaviListener(MapNaviListener listener)

Removes a navigation event listener.

void

searchAlongRoute(SearchAlongRequest request)

Performs search along the route.

boolean

selectRouteId(int id)

Selects a route ID.

void

setAccessToken(String token)

Sets an access token.

void

setApiKey(String apiKey)

Sets an authentication key.

void

setAutoRefreshTrafficInfo(boolean autoRefresh)

Sets whether to automatically refresh the real-time traffic status.

boolean

setBroadcastingType(BroadcastingType broadcastingType)

Sets a custom broadcast type.

void

setCameraRemindSwitch(final boolean cameraRemindSwitch)

Sets whether to enable the camera reminder switch. (This method is applicable only to driving navigation.)

void

setCoordinateSystem(String coordinateSystem)

Sets the coordinate system.

void

setDevServerSite(@DevServerSiteConstant String devServerSite)

Sets the device server site. This method must be called after MapNavi is instantiated.

void

setEmulatorNaviSpeed(int speed)

Sets the speed for simulated navigation.

void

setEventPointBroad(NaviBroadInfo naviBroadInfo)

Sets event points.

boolean

setFstLanguage(String fstLanguage)

Sets the first broadcast language.

void

setGender(int gender)

Sets the broadcast voice type.

boolean

setLanguage(final String lang)

Sets the language.

void

setLocationContext(Context context)

Sets the context of the built-in location engine.

void

setNaviBroadSettingInfo(NaviBroadSettingInfo naviBroadSettingInfo)

Sets navigation broadcast configurations.

boolean

setNaviOption(NaviOption option)

Sets navigation options.

boolean

setNaviSettings(Map<MapNaviSettingEnums, Object> settings)

Sets navigation settings.

boolean

setOfflineMode(boolean offlineMode)

Sets whether to use the offline mode in priority.

boolean

setOfflineSpokenLanguage(String spkLang)

Sets the spoken language for offline voice broadcast.

void

setPrivateDestination(boolean privateDestination)

Sets whether to enable private end point.

void

setReportOMPSwitch(boolean isReport)

Sets whether to report O&M data.

void

setRoadNameTTS(boolean roadNameTTS)

Sets whether to enable road name TTS.

void

setScreenMode(String screenMode)

Sets the screen mode.

boolean

setSecLanguage(String secLanguage)

Sets the second broadcast language.

void

setSendLocationListSwitch(boolean locationListSwitch)

Sets whether to report the track.

void

setStopStartSupplementary(boolean stopStartSupplementary)

Sets whether to supplement broadcast for navigation start and stop.

void

setStrongStraightTTS(boolean strongStraightTTS)

Sets whether to broadcast strong forward points (a type of maneuver point).

void

setTrajShareSwitch(boolean opened)

Sets whether to share the track to third parties.

void

setTtsPlaying(boolean isPlaying, int broadId)

Sets the voice broadcast status.

void

setTurningSupplementary(boolean turningSupplementary)

Sets whether to supplement broadcast before turning.

void

setUnits(int pUnits)

Sets the measurement unit used for broadcast. The imperial and metric (default) units are supported.

boolean

setUseExtraLocationData(boolean extraLocationDataEnabled)

Sets whether to use external location data.

void

setUseExtraTTS(boolean extraTTSEnabled)

Sets whether to use external TTS.

boolean

setVehicleType(Vehicletype vehicletype)

Sets the transport mode.

boolean

startCruise(RoutingRequestParam cruiseParam)

Starts the cruise mode.

boolean

startISA(RoutingRequestParam isaParam)

Starts the ISA mode.

boolean

startLocation()

Starts GPS location without input parameters.

boolean

startLocation(long time, int distance)

Starts GPS location with the distance and time parameters.

boolean

startNavi(NaviMode naviMode)

Starts navigation.

void

stopCruise()

Stops the cruise mode.

void

stopISA()

Stops the ISA mode.

void

stopLocation()

Stops GPS location.

void

stopNavi()

Stops navigation.

void

switchParallelRoad(ParallelSwitchType type)

Switches parallel roads.

boolean

updateExtraLocationData(android.location.Location location, double sensorBearing)

Updates external location data.

void

updateNetWorkTimeStamp(long timeStamp)

Updates the network timestamp.

void

updateRoute(List<android.location.Location> startPoints)

Updates the route during navigation.

void

updateWayPoints(List<NaviRequestPoint> wayPoints)

Updates waypoints during navigation.

Public Methods

[h2]addAttentServerArea

Method

public void addAttentServerArea(int index)

Adds a favorite service area. Compared with non-favorite service areas, a favorite service area will have a special reminder.

Parameters

Name

Description

index

Index of a service area in the list.

[h2]addMapISAListener

Method

public boolean addMapISAListener(MapISAListener listener)

Adds an ISA listener.

Parameters

Name

Description

listener

ISA listener.

Returns

Type

Description

boolean

true if the ISA listener is added successfully; false otherwise.

[h2]addMapNaviListener

Method

public boolean addMapNaviListener(MapNaviListener listener)

Adds a navigation event listener.

Parameters

Name

Description

listener

Navigation event listener.

Returns

Type

Description

boolean

true if the navigation event listener is added successfully; false otherwise.

[h2]batchQuery

Method

public void batchQuery(BatchQueryRequest request)

Queries routes in batches.

Parameters

Name

Description

request

Request body for querying routes in batches. For details, please refer to BatchQueryRequest.

[h2]calculateAccessTypeOfTTS

Method

public boolean calculateAccessTypeOfTTS(DeliverConfigReqDTO deliverConfigReqDTO)

Obtains the TTS engine type. Apps can use this method to calculate the access type of TTS.

Parameters

Name

Description

deliverConfigReqDTO

Voice configuration delivery parameters. For details please refer to DeliverConfigReqDTO.

Returns

Type

Description

boolean

  • true: request successful
  • false: request failed

[h2]calculateBusDriveRoute

Method

public boolean calculateBusDriveRoute(BusCqlRequest busCqlRequest)

Calculates public transit routes. Before calling this method, ensure that VehicleType has been set correctly.

Parameters

Name

Description

busCqlRequest

Public transit route planning parameters. For details, please refer to BusCqlRequest.

Returns

Type

Description

boolean

true if public transit routes are calculated successfully; false otherwise.

[h2]calculateCycleRoute

Method

public boolean calculateCycleRoute(RoutingRequestParam requestParam)

Calculates cycling routes. Before calling this method, ensure that VehicleType has been set correctly.

Parameters

Name

Description

requestParam

Cycling route planning parameters. For details, please refer to RoutingRequestParam.

Returns

Type

Description

boolean

true if cycling routes are calculated successfully; false otherwise.

[h2]calculateCyclingGuide

Method

public boolean calculateCyclingGuide()

Calculates cycling guidance. This method must be called after route planning is completed. Before calling this method, ensure that VehicleType has been set correctly.

Returns

Type

Description

boolean

true if the guidance is calculated successfully; false otherwise.

[h2]calculateDriveGuide

Method

public boolean calculateDriveGuide()

Calculates driving guidance. This method must be called after route planning is completed. Before calling this method, ensure that VehicleType has been set correctly.

Returns

Type

Description

boolean

true if the guidance is calculated successfully; false otherwise.

[h2]calculateDriveRoute

Method

public boolean calculateDriveRoute(RoutingRequestParam driveRequest)

Calculates driving routes. Before calling this method, ensure that VehicleType has been set correctly.

Parameters

Name

Description

driveRequest

Driving route planning parameters. For details, please refer to RoutingRequestParam.

Returns

Type

Description

boolean

true if driving routes are calculated successfully; false otherwise.

[h2]calculateRealTimeBusInfo

Method

public boolean calculateRealTimeBusInfo(RealTimeTransitRequest realTimeTransitRequest)

Checks whether real-time transit information is queried successfully.

Parameters

Name

Description

realTimeTransitRequest

Real-time transit information request object.

Returns

Type

Description

boolean

Whether real-time transit information is queried successfully.

[h2]calculateWalkGuide

Method

public boolean calculateWalkGuide()

Calculates walking guidance. This method must be called after route planning is completed. Before calling this method, ensure that VehicleType has been set correctly.

Returns

Type

Description

boolean

true if the guidance is calculated successfully; false otherwise.

[h2]calculateWalkRoute

Method

public boolean calculateWalkRoute(RoutingRequestParam requestParam)

Calculates walking routes. Before calling this method, ensure that VehicleType has been set correctly.

Parameters

Name

Description

requestParam

Walking route planning parameters. For details, please refer to RoutingRequestParam.

Returns

Type

Description

boolean

true if walking routes are calculated successfully; false otherwise.

[h2]cancelBroadInfo

Method

public void cancelBroadInfo(String broadText)

Cancels event point broadcast.

Parameters

Name

Description

broadText

Broadcast text.

[h2]changeRouteId

Method

public boolean changeRouteId(int id)

Changes the route to an alternative route.

Parameters

Name

Description

id

Route ID.

Returns

Type

Description

boolean

true if the route is changed to an alternative route successfully; false otherwise.

[h2]clear

Method

public void clear()

Clears navigation data, after which the SDK function is still available.

[h2]clearAllAttentServerArea

Method

public void clearAllAttentServerArea()

Clears service area information for all routes.

[h2]clearCurPathAttentServerArea

Method

public void clearCurPathAttentServerArea()

Clears service area information for the current route.

[h2]destroy

Method

public void destroy()

Destroys the navigation object to release resources.

[h2]existAttentServerArea

Method

public boolean existAttentServerArea(int index)

Checks whether the service area with the specified index has been added to favorites.

Parameters

Name

Description

index

Index of the service area to be checked.

Returns

Type

Description

boolean

true if the service area has been added to favorites; false otherwise.

[h2]getAllAttentServerArea

Method

public Map<Integer, List<FurnitureInfo>> getAllAttentServerArea()

Obtains service area information of all routes.

Returns

Type

Description

Map<Integer, List<FurnitureInfo>>

Service area information of all routes, that is, a list of service area inducing points of each route. For details about inducing points, please refer to FurnitureInfo.

[h2]getCurPathFullBroadcastTextsRemovePercent

Method

public List<String> getCurPathFullBroadcastTextsRemovePercent()

Obtains all broadcast texts excepting those including %d for the current route.

Returns

Type

Description

List<String>

All broadcast texts excepting those including %d for the current route.

[h2]getFullScreenNaviVoiceText

Method

public String getFullScreenNaviVoiceText()

Obtains the broadcast text for full-screen lane-level guidance.

Returns

Type

Description

String

Broadcast text for full-screen lane-level guidance.

[h2]getFutureEta

Method

public boolean getFutureEta(FutureEtaOptions options)

Obtains a list of future ETAs.

Parameters

Name

Description

options

Future ETA parameters. For details, please refer to FutureEtaOptions.

Returns

Type

Description

boolean

  • true: request successful
  • false: request failed

[h2]getGpsLostVoiceText

Method

public String getGpsLostVoiceText()

Obtains the broadcast text for GPS signal loss.

Returns

Type

Description

String

Broadcast text for GPS signal loss.

[h2]getInstance

Method

public static final MapNavi getInstance(android.content.Context context)

Obtains a MapNavi object. You need to create a MapNavi object before calling setDevServerSite to set a device server site to initialize the network request domain name and calling setApiKey to set the API key.

Parameters

Name

Description

context

Context.

Returns

Type

Description

MapNavi

MapNavi object.

[h2]getJamTTSText

Method

public String getJamTTSText()

Obtains the broadcast text for traffic jam.

Returns

Type

Description

String

Broadcast text for traffic jam.

[h2]getMapNaviStaticInfo

Method

public MapNaviStaticInfo getMapNaviStaticInfo()

Obtains navigation statistics information.

Returns

Type

Description

MapNaviStaticInfo

Navigation statistics information.

[h2]getNaviPath

Method

public MapNaviPath getNaviPath()

Obtains the current walking or driving route. If multiple routes are planned, the selected route will be obtained.

Returns

Type

Description

MapNaviPath

Current walking or driving route.

[h2]getNaviPaths

Method

public HashMap<Integer, MapNaviPath> getNaviPaths()

Obtains multiple planned routes.

Returns

Type

Description

HashMap<Integer, MapNaviPath>

A list of multiple route IDs and objects.

[h2]getReachableBoundary

Method

public void getReachableBoundary(NewEnergyRequest request)

(New energy) Obtains the reachable boundary and nearby search result.

Parameters

Name

Description

request

Reachable boundary and nearby search request class. For details, please refer to NewEnergyRequest.

[h2]getSDKVersion

Method

public String getSDKVersion()

Obtains the SDK version number.

Returns

Type

Description

String

SDK version number.

[h2]getVehicleType

Method

public VehicleType getVehicleType()

Obtains the navigation engine type.

Returns

Type

Description

VehicleType

Navigation engine type.

[h2]getVoiceByte

Method

public String getVoiceByte(VoiceRequest voiceRequest)

Obtains the PCM voice stream converted from the text.

Parameters

Name

Description

voiceRequest

TTS parameters. for details, please refer to VoiceRequest.

Returns

Type

Description

String

ID of the request for converting the text to the PCM voice stream.

[h2]initLogSettings

Method

public void initLogSettings(boolean log2FileEnabled, String logFilePath)

Initializes log settings.

Parameters

Name

Description

log2FileEnabled

Indicates whether to enable logging.

  • true: yes
  • false: no

The default value is false.

logFilePath

Log file storage path. This parameter takes effect only when log2FileEnabled is set to true.

[h2]initOfflineMode

Method

public OfflineInitErrorCode initOfflineMode(OfflineDataStateRequest request)

Initializes offline data.

Parameters

Name

Description

request

Initialization parameter for offline navigation. For details, please refer to OfflineDataStateRequest.

Returns

Type

Description

OfflineInitErrorCode

Result code for offline navigation initialization.

[h2]initSettings

Method

public void initSettings(ClientParas clientParas)

Initializes settings.

Parameters

Name

Description

clientParas

ClientParas object, which contains initial parameters for a third party to call the Navi SDK.

[h2]interruptsBusRequest

Method

public void interruptsBusRequest()

Cancels the request for planning public transit routes.

[h2]isAutoRefreshTrafficInfo

Method

public boolean isAutoRefreshTrafficInfo()

Checks whether the traffic information is automatically refreshed.

Returns

Type

Description

boolean

Whether the traffic information is automatically refreshed.

  • true: yes
  • false: no

[h2]isDayTime

Method

public static DayNightMsg isDayTime(NaviLatLng latLng)

Checks whether the input longitude-latitude location is currently in daytime or at night.

Parameters

Name

Description

latlng

Passed longitude-latitude location. (The method will check whether the location is currently in daytime or at night.)

Returns

Type

Description

DayNightMsg

Whether the input longitude-latitude location is currently in daytime or at night.

[h2]isDisplayETA

Method

public boolean isDisplayETA()

Checks whether the ETA is displayed.

Returns

Type

Description

boolean

Whether the ETA is displayed.

  • true: yes
  • false: no

[h2]isRoutePathSelected

Method

public boolean isRoutePathSelected(int id)

Checks whether the route with the specified ID is selected.

Parameters

Name

Description

id

Specified route ID.

Returns

Type

Description

boolean

Whether the route with the specified ID is selected.

  • true: yes
  • false: no

[h2]removeAttentServerArea

Method

public void removeAttentServerArea(int index)

Removes a favorite service area.

Parameters

Name

Description

index

Index of the favorite service area

[h2]removeMapISAListener

Method

public void removeMapISAListener(MapISAListener listener)

Removes an ISA listener.

Parameters

Name

Description

listener

ISA listener.

[h2]removeMapNaviListener

Method

public void removeMapNaviListener(MapNaviListener listener)

Removes a navigation event listener.

Parameters

Name

Description

listener

Navigation event listener.

[h2]searchAlongRoute

Method

public void searchAlongRoute(SearchAlongRequest request)

Performs search along the route.

Parameters

Name

Description

request

Request of search along the route. For details, please refer to SearchAlongRequest.

[h2]selectRouteId

Method

public boolean selectRouteId(int id)

Selects a route ID.

Parameters

Name

Description

id

ID of the selected route.

Returns

Type

Description

boolean

Whether the route is selected successfully.

[h2]setAccessToken

Method

public void setAccessToken(String token)

Sets an access token. For details, please refer to Obtaining the API Key. The obtained key must be encoded before being passed.

Parameters

Name

Description

token

Access token.

[h2]setApiKey

Method

public void setApiKey(String apiKey)

Sets an authentication key. For details, please refer to Obtaining the API Key. The obtained key must be encoded before being passed.

Parameters

Name

Description

apiKey

API key.

[h2]setAutoRefreshTrafficInfo

Method

public void setAutoRefreshTrafficInfo(boolean autoRefresh)

Sets whether to automatically refresh the real-time traffic status.

Parameters

Name

Description

autoRefresh

Indicates whether to automatically refresh the real-time traffic status.

  • true: yes
  • false: no

[h2]setBroadcastingType

Method

public boolean setBroadcastingType(BroadcastingType broadcastingType)

Sets a custom broadcast type.

Parameters

Name

Description

broadcastingType

Custom broadcast type.

Returns

Type

Description

boolean

Whether the setting is successful.

[h2]setCameraRemindSwitch

Method

public void setCameraRemindSwitch(final boolean cameraRemindSwitch)

Sets whether to enable the camera reminder switch.

Parameters

Name

Description

cameraRemindSwitch

Whether camera reminder broadcast is enabled.

  • true: yes
  • false: no

[h2]setCoordinateSystem

Method

public void setCoordinateSystem(String coordinateSystem)

Sets the coordinate system.

Parameters

Name

Description

coordinateSystem

Coordinate system.

  • WGS-84
  • GCJ-02

[h2]setDevServerSite

Method

public void setDevServerSite( @DevServerSiteConstant String devServerSite)

Sets the device server site. This method must be called after MapNavi is instantiated.

Parameters

Name

Description

devServerSite

Device server site.

[h2]setEmulatorNaviSpeed

Method

public void setEmulatorNaviSpeed(int speed)

Sets the speed for simulated navigation.

Parameters

Name

Description

speed

Speed for simulated navigation, in km/h.

[h2]setEventPointBroad

Method

public void setEventPointBroad(NaviBroadInfo naviBroadInfo)

Sets event points. Currently, only the event point for GPS signal loss is supported.

Parameters

Name

Description

naviBroadInfo

Broadcast information class. For details, please refer to NaviBroadInfo.

[h2]setFstLanguage

Method

public boolean setFstLanguage(String fstLanguage)

Sets the first broadcast language.

Parameters

Name

Description

fstLanguage

First broadcast language. Currently, only Chinese and English (default) are supported.

  • en-us: English
  • zh-CN: Chinese

Returns

Type

Description

boolean

Whether the setting is successful.

[h2]setGender

Method

public void setGender(int gender)

Sets the broadcast voice type.

Parameters

Name

Description

gender

Broadcast voice type.

  • 0: female voice
  • 1: male voice

[h2]setLanguage

Method

public boolean setLanguage(final String lang)

Sets the language that is used by the server to construct broadcast text.

Parameters

Name

Description

lang

Language that is used by the server to construct broadcast text. Currently, only Chinese and English (default) are supported.

  • en-us: English
  • zh-CN: Chinese

Returns

Type

Description

boolean

Whether the setting is successful.

  • true: yes
  • false: no

[h2]setLocationContext

Method

public void setLocationContext(Context context)

Sets the context of the built-in location engine. If an external location data source is used, you do not need to call this method. If an internal location data source is used, you must call this method before navigation. You can use the setUseExtraLocationData method to set the location data source.

Parameters

Name

Description

context

Context.

[h2]setNaviBroadSettingInfo

Method

public void setNaviBroadSettingInfo(NaviBroadSettingInfo naviBroadSettingInfo)

Sets navigation broadcast configurations.

Parameters

Name

Description

naviBroadSettingInfo

Navigation broadcast setting information.

[h2]setNaviOption

Method

public boolean setNaviOption(NaviOption option)

Sets navigation options. The set options take effect immediately.

Parameters

Name

Description

option

Navigation options. For details, please refer to NaviOption.

Returns

Type

Description

boolean

Whether the setting is successful.

  • true: yes
  • false: no

[h2]setNaviSettings

Method

public boolean setNaviSettings(Map<MapNaviSettingEnums, Object> settings)

Sets navigation settings.

Parameters

Name

Description

settings

Navigation settings. For details, please refer to MapNaviSettingEnums.

Returns

Type

Description

boolean

Whether the setting is successful.

  • true: yes
  • false: no

[h2]setOfflineMode

Method

public boolean setOfflineMode(boolean offlineMode)

Sets whether to use the offline mode in priority.

Parameters

Name

Description

offlineMode

  • true: Use the offline mode in priority.
  • false: Use the online mode in priority.

    The default value is false.

Returns

Type

Description

boolean

Whether using the offline mode in priority is set successfully.

  • true: yes
  • false: no

[h2]setOfflineSpokenLanguage

Method

public boolean setOfflineSpokenLanguage(String spkLang)

Sets the spoken language for offline voice broadcast. The system checks whether the spoken language is set in priority. If the spoken language is not set, the common language set using setLanguage(String lang) will be used.

Parameters

Name

Description

spkLang

Spoken language.

Returns

Type

Description

boolean

true if the spoken language is set successfully; false otherwise.

[h2]setPrivateDestination

Method

public void setPrivateDestination(boolean privateDestination)

Sets whether to enable private end point.

Parameters

Name

Description

privateDestination

Indicates whether to enable private end point.

  • true: yes
  • false: no

The default value is false.

[h2]setReportOMPSwitch

Method

public void setReportOMPSwitch(boolean isReport)

Sets whether to report O&M data.

Parameters

Name

Description

isReport

Indicates whether to report O&M data.

  • true: yes
  • false: no

The default value is false.

[h2]setRoadNameTTS

Method

public void setRoadNameTTS(boolean roadNameTTS)

Sets whether to enable road name TTS.

Parameters

Name

Description

roadNameTTS

Indicates whether to enable road name TTS.

  • true: yes
  • false: no

The default value is false.

[h2]setScreenMode

Method

public void setScreenMode(String screenMode)

Sets the screen mode.

Parameters

Name

Description

screenMode

Screen mode.

  • ScreenModeConstants.SCR_VERTICAL_MODE: landscape mode
  • ScreenModeConstants.SCR_HORIZONTAL_MODE: portrait mode

[h2]setSecLanguage

Method

public boolean setSecLanguage(String secLanguage)

Sets the second broadcast language.

Parameters

Name

Description

secLanguage

Second broadcast language.

Returns

Type

Description

boolean

Whether the setting is successful.

[h2]setSendLocationListSwitch

Method

public void setSendLocationListSwitch(boolean locationListSwitch)

Sets whether to report the track.

Parameters

Name

Description

locationListSwitch

Indicates whether to report the track.

  • true: yes
  • false: no

[h2]setStopStartSupplementary

Method

public void setStopStartSupplementary(boolean stopStartSupplementary)

Sets whether to supplement broadcast for navigation start and stop.

Parameters

Name

Description

stopStartSupplementary

Indicates whether to supplement broadcast for navigation start and stop.

  • true: yes
  • false: no

[h2]setStrongStraightTTS

Method

public void setStrongStraightTTS(boolean strongStraightTTS)

Sets whether to broadcast strong forward points (a type of maneuver point).

Parameters

Name

Description

strongStraightTTS

Indicates whether to broadcast strong forward points.

  • true: yes
  • false: no

[h2]setTrajShareSwitch

Method

public void setTrajShareSwitch(boolean opened)

Sets whether to share the track to third parties.

Parameters

Name

Description

opened

Indicates whether to share the track to a third party.

  • true: yes
  • false: no

[h2]setTtsPlaying

Method

public void setTtsPlaying(boolean isPlaying, int broadId)

Sets the voice broadcast status.

Parameters

Name

Description

isPlaying

Indicates whether the voice broadcast is being played.

  • true: yes
  • false: no

broadId

Broadcast ID.

[h2]setTurningSupplementary

Method

public void setTurningSupplementary(boolean turningSupplementary)

Sets whether to supplement broadcast before turning.

Parameters

Name

Description

turningSupplementary

Indicates whether to supplement broadcast before turning.

  • true: yes
  • false: no

[h2]setUnits

Method

public void setUnits(int pUnits)

Sets the measurement unit used for broadcast. The imperial and metric (default) units are supported.

Parameters

Name

Description

pUnits

Measurement unit.

  • 0: metric unit
  • 1: imperial unit

[h2]setUseExtraLocationData

Method

public boolean setUseExtraLocationData(boolean extraLocationDataEnabled)

Sets whether to use external location data.

Parameters

Name

Description

extraLocationDataEnabled

Indicates whether to use external location data.

Returns

Type

Description

boolean

true if external location data is used; false otherwise.

[h2]setUseExtraTTS

Method

public void setUseExtraTTS(boolean extraTTSEnabled)

Sets whether to use external TTS.

Parameters

Name

Description

extraTTSEnabled

Indicates whether to use external TTS text data.

  • true: The SDK provides only the TTS text data but not the default TTS broadcast.
  • false: The SDK provides only text and does not provide TTS broadcast. You need to implement the broadcast capability by yourself.

[h2]setVehicleType

Method

public boolean setVehicleType(VehicleType vehicleType)

Sets the transport mode.

Parameters

Name

Description

vehicleType

Transport mode. The supported modes include driving, walking, cycling, and public transit.

Returns

Type

Description

boolean

true if the transport mode is set successfully; false otherwise.

[h2]startCruise

Method

public boolean startCruise(RoutingRequestParam cruiseParam)

Starts the cruise mode.

Parameters

Name

Description

cruiseParam

Cruise mode parameters, including whether manual user operation is required and whether to enable consecutive location points, traffic conditions, and cameras. For details, please refer to RoutingRequestParam.

Returns

Type

Description

boolean

true if the cruise mode is enabled successfully; false otherwise.

[h2]startISA

Method

public boolean startISA(RoutingRequestParam isaParam)

Starts the ISA mode.

Parameters

Name

Description

isaParam

ISA planning parameters, including the current location, vehicle type, and other parameters. For details, please refer to RoutingRequestParam.

Returns

Type

Description

boolean

true if the ISA mode is started successfully; false otherwise.

[h2]startLocation()

Method

public boolean startLocation()

Starts GPS location without input parameters.

Returns

Type

Description

boolean

true if GPS location is started successfully; false otherwise.

[h2]startLocation(long time, int distance)

Method

public boolean startLocation(long time, int distance)

Starts GPS location with the distance and time parameters.

Parameters

Name

Description

time

Interval for updating the location, in milliseconds.

distance

Distance between location updates, in meters.

Returns

Type

Description

boolean

true if GPS location is started successfully; false otherwise.

[h2]startNavi

Method

public boolean startNavi(NaviMode naviMode)

Starts navigation.

Parameters

Name

Description

naviMode

Navigation mode.

Returns

Type

Description

boolean

true if navigation is started successfully; false otherwise.

[h2]stopCruise

Method

public void stopCruise()

Stops the cruise mode.

[h2]stopISA

Method

public void stopISA()

Stops the ISA mode.

[h2]stopLocation

Method

public void stopLocation()

Stops GPS location.

[h2]stopNavi

Method

public void stopNavi()

Stops navigation (including GPS location and simulated navigation).

[h2]switchParallelRoad

Method

public void switchParallelRoad(ParallelSwitchType type)

Switches parallel roads.

Parameters

Name

Description

type

Parallel road switch type. For details, please refer to ParallelSwitchType.

[h2]updateExtraLocationData

Method

public boolean updateExtraLocationData(android.location.Location location, double sensorBearing)

Updates external location data.

Parameters

Name

Description

location

android.location.Location object, which contains external location data.

sensorBearing

Bearing of the sensor. You can pass the value -1 to block the sensor.

Returns

Type

Description

boolean

true if external location data is updated successfully; false otherwise.

[h2]updateNetWorkTimeStamp

Method

public void updateNetWorkTimeStamp(long timeStamp)

Updates the network timestamp.

Parameters

Name

Description

timeStamp

New network timestamp.

[h2]updateRoute

Method

public void updateRoute(List<android.location.Location> startPoints)

Updates the route during navigation.

Parameters

Name

Description

startPoints

List of new start points.

[h2]updateWayPoints

Method

public void updateWayPoints(List<NaviRequestPoint> wayPoints)

Updates waypoints during navigation.

Parameters

Name

Description

wayPoints

List of waypoints, including the end point. The last point on the list is the route end point, and other points on the list are waypoints.