The location packages defines API which provide turn by turn navigation instruction, the core class is NavigationEngine, it internally includes three working thread
-
Location monitor thread used to monitor current location against current navigation route if there’s one and adjust raw location to the nearest position on the route.
-
Voice command generator generate thread create upcoming voice command based on current step and location and put them to the voice command queue.
-
Voice command processor pick up the voice command from the queue and notify the voice command listenerHere’s state transition diagram of NavigationEngine:
Classes defined in this package
|
WayPoint
|
Define a navigation way point; it defines the name and Lat/Lng pair.
|
|
NavigationEngine
|
Navigation Engine, it internal has a navigation simulation thread ,it support turn by turn navigation , has on road and off road navigation mode, rerouting support etc.
|
|
SimulatedDirectionLocationProvider
|
Simulation location provider, it uses a MapDirection object as the simulation source.
|
|
VoiceCommandArg
|
Voice command argument class, which defines command type, command argument (which usually is the current road name)
|
|
VoiceCommandSpeaker
|
Default implementation for audio command player.
|
|
VoiceCommandType
|
Define all navigation command type, such as distance to a turn, turn left ,turn right etc.
|
|
WalkOnRoute
|
Current position on the route (nearest).
|
|
INavigationListener
|
Navigation listener, which monitor the status of the navigation engine, location update, rerouting status etc.
|
|
IVoiceCommandListener
|
Voice command listener.
|


Leave a comment