MapTrip Interface Android Reference Manual 9.8.0
de.infoware.android.mti.Navigation Class Reference

Static Public Member Functions

static native int insertDestinationCoordinate (int index, double latitude, double longitude)
 
static native int insertGeocodedDestination (int index, int geocodedAddressIndex)
 
static native int insertDestinationAddress (int index, double latitude, double longitude, String name, String country, String city, String district, String zipCode, String street, String houseNr)
 
static native int appendDestinationAddress (double latitude, double longitude, String name, String country, String city, String district, String zipCode, String street, String houseNr)
 
static native int appendGeocodedDestination (int geocodedAddressIndex)
 
static native int appendDestinationCoordinate (double latitude, double longitude)
 
static native int markDestinationCoordinateAsViaPoint (int index, int radiusInMeter)
 
static native int getDestinationCoordinate (int index)
 
static native int getDestinationCoordinateCount ()
 
static native int getCurrentDestination ()
 
static native int removeAllDestinationCoordinates ()
 
static native int calculateRoutes ()
 
static native int getRouteResultsCount ()
 
static native int getRouteLength (int index)
 
static native int getRouteTime (int index)
 
static native int startNavigation ()
 
static native int startAlternativeNavigation ()
 
static native int startTour ()
 
static native int skipNextDestination ()
 
static native int startSimulation ()
 
static native int stopNavigation ()
 
static native int startRouteFromFile (String xmlFile)
 
static native int startReferenceRoute (String routeFile, boolean doGuideThroughStartingPoint)
 
static native int getReferenceRouteFile ()
 
static native int setRoutingModeHybrid (boolean doHybridRouting)
 
static native int syncWithActiveNavigation ()
 
static native int navigateWithGuiGeocoding (String city, String zipCode, String street, String houseNr)
 
static native int setEmergencyRoutingEnabled (boolean enableEmergencyRouting)
 
static native int getEmergencyRoutingEnabled ()
 
static native int setEmergencyRouteRadius (int meters)
 
static native int getEmergencyRouteRadius ()
 
static native int setAsReferenceRoute ()
 
static void addListener (NavigationListener listener)
 
static void removeListener (NavigationListener listener)
 
static void removeAllListeners ()
 

Detailed Description

This class can be used to build a list of navigation goals (ordered list of destinations) and start a navigation.
A list of navigation goals can be created with the methods Navigation.insertDestinationCoordinate() and Navigation.appendDestinationCoordinate(). The list that is created in this way is not visible in maptrip until the function Navigation.startNavigation() is successfully called. This function will copy the mti navigation goal list to maptrip and used it for navigation. While a navigation is running, the destination list can not be modified. If a navigation is stopped or the destination is reached, the destination list should not be further used since reached waypoints will not influence further navigation / routing processes. Use the method Navigation.removeAllDestinationCoordinates().

Attention
If a Navigation is started via the maptrip UI, the MTI navigation list will be overwritten. If this situation occurs the event ApiListener.infoMsg() "MTI_INFO_NAVIGATION_STARTED" will be received.

Member Function Documentation

◆ addListener()

static void de.infoware.android.mti.Navigation.addListener ( NavigationListener  listener)
static

◆ appendDestinationAddress()

static native int de.infoware.android.mti.Navigation.appendDestinationAddress ( double  latitude,
double  longitude,
String  name,
String  country,
String  city,
String  district,
String  zipCode,
String  street,
String  houseNr 
)
static

Appends an address to the MTI destination list. The Coordinate at the last index (highest index) is the final destination. To retrieve coordinates for an address use the geocoder Geocoder.geocodeAddress(). Destination coordinates can only be added if no navigation is running.

Parameters
latitude- WGS84
longitude- WGS84
name- name of the address
country- country of the address that shall be geocoded 3-letter ISO format on MapTrip 4.0, previous versions use the vehicle registration codes. Optional to reduce the search space: if left blank all countries of the installed mapdata will be searched.
city- city / district of the address that shall be geocoded.
district- district - not yet used for geocoding
zipCode- zipcode of the address that shall be geocoded; It is not possible to search only for a zip code ( without street or city )
street- street of the address that shall be geocoded
houseNr- housenumber of the address that shall be geocoded, if no street is given this parameter is ignored. If the passed housenumber does not exist the result for the closest nearest number is returned (e.g. number if 12 or 13 is geocoded but the highest number is 11 the address and coordinate of 11 are returned
Returns
Invokes callback NavigationListener.appendDestinationAddressResult().

◆ appendDestinationCoordinate()

static native int de.infoware.android.mti.Navigation.appendDestinationCoordinate ( double  latitude,
double  longitude 
)
static

Appends a coordinate to the MTI destination list Destination coordinates can only be added if no navigation is running.

Parameters
latitude- WGS84
longitude- WGS84
Returns
Invokes callback NavigationListener.appendDestinationCoordinateResult().

◆ appendGeocodedDestination()

static native int de.infoware.android.mti.Navigation.appendGeocodedDestination ( int  geocodedAddressIndex)
static

Appends a geocoded address to the MTI destination list The address that shall be inserted is selected via the index of a geocoded address of a previous geocoding request ( see Geocoder.geocodeAddress() and Geocoder.getGeocodedAddress() ) Destination coordinates can only be added if no navigation is running.

Precondition
Requires: previous successful call to Geocoder.geocodeAddress().

Parameters
geocodedAddressIndex- index of an address from the last geocoding result that shall be added; 0 based
Returns
Invokes callback NavigationListener.insertDestinationCoordinateResult().

◆ calculateRoutes()

static native int de.infoware.android.mti.Navigation.calculateRoutes ( )
static

It is usually not necessary to tell MapTrip, that routes must be calculated. This is done automatically, if you start the guidance with Navigation.startNavigation(). But if you first want to display some route metrics in your own application without starting the guidance, you should use this function.

It calculates the routes subsequently to all destinations, that has been specified either manually or by a successful call of Navigation.insertDestinationCoordinate() , Navigation.appendDestinationCoordinate() , Navigation.appendGeocodedDestination() or Navigation.insertGeocodedDestination() .
The first route is calculated from the current position to the first destination, the second route is calculated from the first destination to the second destination and so on.

There are several reasons why the route could not calculated even if there is at least one target address available. Maybe there is no valid GPS position available, no route could be calculated or the user cancels the navigation.

Returns
Invokes callback NavigationListener.calculateRoutesResult().

◆ getCurrentDestination()

static native int de.infoware.android.mti.Navigation.getCurrentDestination ( )
static

Get the index of the current destination in the destination list. The destination can then be received via Navigation.getDestinationCoordinate().

Returns
Invokes callback NavigationListener.getCurrentDestinationResult().

◆ getDestinationCoordinate()

static native int de.infoware.android.mti.Navigation.getDestinationCoordinate ( int  index)
static

Get a specific navigation goal in the navigation goals list.

Parameters
index- 0 based index of the navigation goal to be retrieved
Returns
Invokes callback NavigationListener.getDestinationCoordinateResult().

◆ getDestinationCoordinateCount()

static native int de.infoware.android.mti.Navigation.getDestinationCoordinateCount ( )
static

Get the number of destination coordinates in the destination list.

Returns
Invokes callback NavigationListener.getDestinationCoordinateCountResult().

◆ getEmergencyRouteRadius()

static native int de.infoware.android.mti.Navigation.getEmergencyRouteRadius ( )
static

Retrieve the emergency route radius in meters.

Returns

◆ getEmergencyRoutingEnabled()

static native int de.infoware.android.mti.Navigation.getEmergencyRoutingEnabled ( )
static

Retrieve information about the status of emergency routing. Is it enabled and/or active.

Returns

◆ getReferenceRouteFile()

static native int de.infoware.android.mti.Navigation.getReferenceRouteFile ( )
static

Get the file that is currently used for reference route navigation.

Returns

◆ getRouteLength()

static native int de.infoware.android.mti.Navigation.getRouteLength ( int  index)
static

Returns the length in meters of a previously calculated route.

Parameters
index- 0 based index of the route result
Returns
Invokes no callback.

◆ getRouteResultsCount()

static native int de.infoware.android.mti.Navigation.getRouteResultsCount ( )
static

Returns the number of previously calculated routes. There must be at least one successful call of Navigation.calculateRoutes() , mti_nav_startNavigation , Navigation.startSimulation(), Navigation.startReferenceRoute() or Navigation.startRouteFromFile() .

Returns
  • number of results
Invokes no callback.

◆ getRouteTime()

static native int de.infoware.android.mti.Navigation.getRouteTime ( int  index)
static

Returns the time in seconds of a previously calculated route.

Parameters
index- 0 based index of the route result
Returns
Invokes no callback.

◆ insertDestinationAddress()

static native int de.infoware.android.mti.Navigation.insertDestinationAddress ( int  index,
double  latitude,
double  longitude,
String  name,
String  country,
String  city,
String  district,
String  zipCode,
String  street,
String  houseNr 
)
static

Adds an address to the MTI destination list before the element at the given index. The Coordinate at the last index (highest index) is the final destination. To retrieve coordinates for an address use the geocoder Geocoder.geocodeAddress(). Destination coordinates can only be added if no navigation is running.

Parameters
index- index in the destination list where the address shall be inserted; 0 based;
latitude- WGS84
longitude- WGS84
name- name of the address
country- country of the address that shall be geocoded 3-letter ISO format on MapTrip 4.0, previous versions use the vehicle registration codes. Optional to reduce the search space: if left blank all countries of the installed mapdata will be searched.
city- city / district of the address that shall be geocoded.
district- district - not yet used for geocoding
zipCode- zipcode of the address that shall be geocoded; It is not possible to search only for a zip code ( without street or city )
street- street of the address that shall be geocoded
houseNr- housenumber of the address that shall be geocoded, if no street is given this parameter is ignored. If the passed housenumber does not exist the result for the closest nearest number is returned (e.g. number if 12 or 13 is geocoded but the highest number is 11 the address and coordinate of 11 are returned
Returns
Invokes callback NavigationListener.insertDestinationAddressResult().

◆ insertDestinationCoordinate()

static native int de.infoware.android.mti.Navigation.insertDestinationCoordinate ( int  index,
double  latitude,
double  longitude 
)
static

Adds a coordinate to the MTI destination list before the element at the given index. The Coordinate at the last index (highest index) is the final destination. To retrieve coordinates for an address use the geocoder Geocoder.geocodeAddress(). Destination coordinates can only be added if no navigation is running.

Parameters
index- index in the destination list where the address shall be inserted; 0 based;
latitude- WGS84
longitude- WGS84
Returns
Invokes callback NavigationListener.insertDestinationCoordinateResult().

◆ insertGeocodedDestination()

static native int de.infoware.android.mti.Navigation.insertGeocodedDestination ( int  index,
int  geocodedAddressIndex 
)
static

Adds a geocoded address to the MTI destination list before the element at the given index. The Coordinate at the last index (highest index) is the final destination. The address that shall be inserted is selected via the index of a geocoded address of a previous geocoding request ( see Geocoder.geocodeAddress() and Geocoder.getGeocodedAddress() ) Destination coordinates can only be added if no navigation is running.

Precondition
Requires: previous successful call to Geocoder.geocodeAddress().

Parameters
index- index in the destination list where the address shall be inserted; 0 based;
geocodedAddressIndex- index of an address from the last geocoding result that shall be added; 0 based
Returns
Invokes callback NavigationListener.insertDestinationCoordinateResult().

◆ markDestinationCoordinateAsViaPoint()

static native int de.infoware.android.mti.Navigation.markDestinationCoordinateAsViaPoint ( int  index,
int  radiusInMeter 
)
static

Sets an existing navigation goal in the MTI destination list as via point with a given radius. If the radius is set to 0 the waypoint will be treated as intermediate target again. A final destination waypoint can not be a via point. Via points can only be set if no navigation is running.

Parameters
index- index of the navigation goal in the destination list that shall be used as via point;
radiusInMeter- radius in meters
Returns
Invokes callback NavigationListener.markDestinationCoordinateAsViaPointResult().

◆ navigateWithGuiGeocoding()

static native int de.infoware.android.mti.Navigation.navigateWithGuiGeocoding ( String  city,
String  zipCode,
String  street,
String  houseNr 
)
static

Opens the geocoder view in the GUI, where the individual fields are filled in with the passed parameters. The user has the possibility to select the appropriate place that is identified as match by geocoder ( if multiple ) or modify the input f.e. if no result or a wrong result is found

Parameters
city- city / district of the address that shall be geocoded.
zipCode- zipcode of the address that shall be geocoded; It is not possible to search only for a zip code ( without street or city )
street- street of the address that shall be geocoded
houseNr- housenumber of the address that shall be geocoded, if no street is given this parameter is ignored. If the passed housenumber does not exist the result for the closest nearest number is returned (e.g. number if 12 or 13 is geocoded but the highest number is 11 the address and coordinate of 11 are returned
Returns
Invokes callback NavigationListener.navigateWithGuiGeocodingResult().

◆ removeAllDestinationCoordinates()

static native int de.infoware.android.mti.Navigation.removeAllDestinationCoordinates ( )
static

Remove all destination coordinates from the destination coordinate list.

Returns
Invokes callback NavigationListener.removeAllDestinationCoordinatesResult().

◆ removeAllListeners()

static void de.infoware.android.mti.Navigation.removeAllListeners ( )
static

◆ removeListener()

static void de.infoware.android.mti.Navigation.removeListener ( NavigationListener  listener)
static

◆ setAsReferenceRoute()

static native int de.infoware.android.mti.Navigation.setAsReferenceRoute ( )
static

If you call this function, the next calculated route will be used as a reference route for subsequent reroutings. Before the route calculation starts, every inter station (a station without a via point radius) will become a via point with a radius of 50 meters. After the calculation, all via points will be deleted.

Returns

◆ setEmergencyRouteRadius()

static native int de.infoware.android.mti.Navigation.setEmergencyRouteRadius ( int  meters)
static

Sets the emergency route radius. If enabled, emergency routing will not become effective until the vehicle position is within a radius to the destination which is specified as a preference setting in MapTrip.

Parameters
meters- radius in meters
Returns

◆ setEmergencyRoutingEnabled()

static native int de.infoware.android.mti.Navigation.setEmergencyRoutingEnabled ( boolean  enableEmergencyRouting)
static

Enable or disable emergency routing. If enabled, emergency routing will not become effective until the vehicle position is within a radius to the destination which is specified as a preference setting in MapTrip.

Parameters
enableEmergencyRouting- if set to true, emergency routing will be enabled
Returns

◆ setRoutingModeHybrid()

static native int de.infoware.android.mti.Navigation.setRoutingModeHybrid ( boolean  doHybridRouting)
static

Set the routing mode to Hybrid or Offline. If set to Hybrid, the routes will be requested from a server, which can profide added value due to a richer data set. Especially the current traffic situation is taken into account. If no data connection is avaialable, the hybrid mode will calculate the route on the device itselt. If set to false the routing will be onboard and calculated from the device itself always.

Parameters
doHybridRouting- if set to true, the route will be calculate by a server whenever possible, if false it is always calculated from the device itself
Returns

◆ skipNextDestination()

static native int de.infoware.android.mti.Navigation.skipNextDestination ( )
static

Skips the next destination of a tour that was started via Navigation.startTour()

Returns
Invokes callback NavigationListener.skipNextDestinationResult().

◆ startAlternativeNavigation()

static native int de.infoware.android.mti.Navigation.startAlternativeNavigation ( )
static

Switches to the GUI and lets the user select a route if at least one destination has been specified either manually or by a successful call of Navigation.insertDestinationCoordinate() , Navigation.appendDestinationCoordinate() , Navigation.appendGeocodedDestination() or Navigation.insertGeocodedDestination() .

There are several reasons why the navigation could not start even if there is at least one target address available. Maybe there is no valid GPS position available, no route could be calculated or the user cancels the navigation.

Returns
Invokes callback NavigationListener.startAlternativeNavigationResult().

◆ startNavigation()

static native int de.infoware.android.mti.Navigation.startNavigation ( )
static

Switches to the Map view and starts a navigation if at least one destination has been specified either manually or by a successful call of Navigation.insertDestinationCoordinate() , Navigation.appendDestinationCoordinate() , Navigation.appendGeocodedDestination() or Navigation.insertGeocodedDestination() .

There are several reasons why the navigation could not start even if there is at least one target address available. Maybe there is no valid GPS position available, no route could be calculated or the user cancels the navigation.

Returns
Invokes callback NavigationListener.startNavigationResult().

◆ startReferenceRoute()

static native int de.infoware.android.mti.Navigation.startReferenceRoute ( String  routeFile,
boolean  doGuideThroughStartingPoint 
)
static

Switches to the Map view and starts a Reference Route Navigation along a route that is stored in a passed file location. The route must be specified either in nmea or csv format. A reference route is predefined route that is followed exactly as defined in the passed file.

The file will be directly passed to maptrip ( and not loaded into the MTI destination list) and a navigation is started. Navigation can be stopped via Navigation.stopNavigation().

The format of the csv file is: First line of the file is "longitude;latitude" The following lines contain the longitude and latitude values, e.g. "12.937396;47.817053".

Parameters
doGuideThroughStartingPoint- if set to true, the route from the current position leads to the starting point of the ref route, otherwise the the vehicle is guided to the nearest connection to the ref route
routeFile- route that shall be started in nmea or csv format
Returns
Invokes callback NavigationListener.startReferenceRouteResult().

◆ startRouteFromFile()

static native int de.infoware.android.mti.Navigation.startRouteFromFile ( String  xmlFile)
static

Switches to the Map view and starts a navigation along a route that is stored in a passed file location. The route must be specified in MapTrip xml format.

  • All stations defined in the file will be used as destinations.

The file will be directly passed to maptrip ( and not loaded into the MTI destination list) and a navigation is started. Navigation can be stopped via Navigation.stopNavigation(). If the file is not in the required format ( e.g invalid xml ) no Navigation will be started

Returns
Invokes callback NavigationListener.startRouteFromFileResult().

◆ startSimulation()

static native int de.infoware.android.mti.Navigation.startSimulation ( )
static

Switches to the Map view and starts a simulated navigation. The first inserted destination is the starting point of the simulation. To add destinations call Navigation.insertDestinationCoordinate() , Navigation.appendDestinationCoordinate() , Navigation.appendGeocodedDestination() or Navigation.insertGeocodedDestination() .

Returns
Invokes callback NavigationListener.startSimulationResult().

◆ startTour()

static native int de.infoware.android.mti.Navigation.startTour ( )
static

Switches to the Map view and starts a tour if a tour has been specified either manually or by a successful call of Navigation.insertDestinationCoordinate() , Navigation.appendDestinationCoordinate() , Navigation.appendGeocodedDestination() or Navigation.insertGeocodedDestination() .

There are several reasons why the navigation could not start even if there is at least one target address available. Maybe there is no valid GPS position available, no route could be calculated or the user cancels the navigation.

Returns
Invokes callback NavigationListener.startTourResult().

◆ stopNavigation()

static native int de.infoware.android.mti.Navigation.stopNavigation ( )
static

Stops the current running navigation.

◆ syncWithActiveNavigation()

static native int de.infoware.android.mti.Navigation.syncWithActiveNavigation ( )
static

Synchronizes the itinerary and destinations with MapTrip. The MTI interface synhronizes its intinerary and destinations with the MapTrip application when a navigation is started, either from MapTrip, or from MTI. If now a navigation is already running in MapTrip before the MTI is initialized, the MTI does not know about the current destinations and the destination list. This method allows you to synchronize the current destination and itinierary in that case.

Returns