![]() |
MapTrip Interface Android Reference Manual 9.8.0
|
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 () |
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().
|
static |
|
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.
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 |
|
static |
Appends a coordinate to the MTI destination list Destination coordinates can only be added if no navigation is running.
latitude | - WGS84 |
longitude | - WGS84 |
|
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.
geocodedAddressIndex | - index of an address from the last geocoding result that shall be added; 0 based |
|
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.
|
static |
Get the index of the current destination in the destination list. The destination can then be received via Navigation.getDestinationCoordinate().
|
static |
Get a specific navigation goal in the navigation goals list.
index | - 0 based index of the navigation goal to be retrieved |
|
static |
Get the number of destination coordinates in the destination list.
|
static |
Retrieve the emergency route radius in meters.
|
static |
Retrieve information about the status of emergency routing. Is it enabled and/or active.
|
static |
Get the file that is currently used for reference route navigation.
|
static |
Returns the length in meters of a previously calculated route.
index | - 0 based index of the route result |
|
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() .
|
static |
Returns the time in seconds of a previously calculated route.
index | - 0 based index of the route result |
|
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.
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 |
|
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.
index | - index in the destination list where the address shall be inserted; 0 based; |
latitude | - WGS84 |
longitude | - WGS84 |
|
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.
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 |
|
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.
index | - index of the navigation goal in the destination list that shall be used as via point; |
radiusInMeter | - radius in meters |
|
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
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 |
|
static |
Remove all destination coordinates from the destination coordinate list.
|
static |
|
static |
|
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.
|
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.
meters | - radius in meters |
|
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.
enableEmergencyRouting | - if set to true, emergency routing will be enabled |
|
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.
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 |
|
static |
Skips the next destination of a tour that was started via Navigation.startTour()
|
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.
|
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.
|
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".
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 |
|
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.
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
|
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() .
|
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.
|
static |
Stops the current running navigation.
|
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.