MapTrip Interface Android Reference Manual 9.10.1
Loading...
Searching...
No Matches
de.infoware.android.mti.Api Class Reference

Static Public Member Functions

final static native int enableLogging (String fileName, int logLevel, int fileSizeInBytes, int fileCount, boolean closeFileMode, boolean debugLogging)
 
final static native int init ()
 
final static native int uninit ()
 
final static native int findServer ()
 
final static native int showApp (String packageName, String activity)
 
final static native int sendText (String text)
 
final static native int getMapVersion ()
 
final static native int getApiVersion ()
 
final static native int getMaptripVersion ()
 
final static native int setSettingsParameter (String section, String parameter, String value)
 
final static native int getSettingsParameter (String section, String parameter)
 
final static native int showServer ()
 
final static native int hideServer ()
 
final static native int stopServer ()
 
final static native int enableNetworkConnections (boolean enable)
 
final static native int setDataUsageMonthlyLimit (int KBytes)
 
final static native int resetDataUsageMonthlyLimit ()
 
final static native int getDataUsageMonthlyLimit ()
 
final static native int getDataUsageRemainingQuota ()
 
final static native int isNetworkConnectionEnabled ()
 
final static native int addBlockagePoint (double xCoord, double yCoord, double radius, boolean persistent, String ID, long startTime, long endTime)
 
final static native int addBlockagePath (List< Double > Coordinates, boolean persistent, String ID, long startTime, long endTime)
 
final static native int addBlockagePolygon (List< Double > Coordinates, boolean persistent, String ID, long startTime, long endTime)
 
final static native int addBlockageOfRoutePart (double meters, boolean persistent, String ID, long startTime, long endTime)
 
final static native int getBlockageCount (boolean persistent)
 
final static native int getBlockageAt (int blockNumber, boolean persistent)
 
final static native int deleteAllBlockages (boolean persistent)
 
final static native int deleteBlockageAt (int blockNumber, boolean persistent)
 
final static native int deleteBlockageByID (String ID, boolean persistent)
 
final static native int customFunction (String param1, String param2)
 
static void addListener (ApiListener listener)
 
static void removeListener (ApiListener listener)
 
static void removeAllListeners ()
 

Detailed Description

Member Function Documentation

◆ addBlockageOfRoutePart()

final static native int de.infoware.android.mti.Api.addBlockageOfRoutePart ( double  meters,
boolean  persistent,
String  ID,
long  startTime,
long  endTime 
)
static

Adds a blockage

Parameters
meters- Length of the route part to be blocked in meters
persistent- True: Blockage is stored persistently in MapTrip. False: Blockage is removed when MapTrip is closed
ID- Unique identifier of the blockage
startTime- Unix time stamp in seconds (since 01.01.1970) when the blockage starts
endTime- Unix time stamp in seconds (since 01.01.1970) when the blockage ends
Returns
Invokes callback ApiListener.addBlockageOfRoutePartResult().

◆ addBlockagePath()

final static native int de.infoware.android.mti.Api.addBlockagePath ( List< Double >  Coordinates,
boolean  persistent,
String  ID,
long  startTime,
long  endTime 
)
static

Adds a blockage The coordinates can be in WGS (longitute, latitude) or in mercator projection.

Parameters
Coordinates- Array of coordinates [x1,y1, x2,y2, ..., xN,yN]
coordCount- Number of points in the Coordinates array
persistent- True: Blockage is stored persistently in MapTrip. False: Blockage is removed when MapTrip is closed
ID- Unique identifier of the blockage
startTime- Unix time stamp in seconds (since 01.01.1970) when the blockage starts
endTime- Unix time stamp in seconds (since 01.01.1970) when the blockage ends
Returns
Invokes callback ApiListener.addBlockagePathResult().

◆ addBlockagePoint()

final static native int de.infoware.android.mti.Api.addBlockagePoint ( double  xCoord,
double  yCoord,
double  radius,
boolean  persistent,
String  ID,
long  startTime,
long  endTime 
)
static

Adds a blockage The coordinates can be in WGS (longitute, latitude) or in mercator projection.

Parameters
xCoord- x coordinate of the point
yCoord- y coordinate of the point
radius- In meters around the point which is blocked
persistent- True: Blockage is stored persistently in MapTrip. False: Blockage is removed when MapTrip is closed
ID- Unique identifier of the blockage
startTime- Unix time stamp in seconds (since 01.01.1970) when the blockage starts
endTime- Unix time stamp in seconds (since 01.01.1970) when the blockage ends
Returns
Invokes callback ApiListener.addBlockagePointResult().

◆ addBlockagePolygon()

final static native int de.infoware.android.mti.Api.addBlockagePolygon ( List< Double >  Coordinates,
boolean  persistent,
String  ID,
long  startTime,
long  endTime 
)
static

Adds a blockage The coordinates can be in WGS (longitute, latitude) or in mercator projection.

Parameters
Coordinates- Array of coordinates [x1,y1, x2,y2, ..., xN,yN]
coordCount- Number of points in the Coordinates array
persistent- True: Blockage is stored persistently in MapTrip. False: Blockage is removed when MapTrip is closed
ID- Unique identifier of the blockage
startTime- Unix time stamp in seconds (since 01.01.1970) when the blockage starts
endTime- Unix time stamp in seconds (since 01.01.1970) when the blockage ends
Returns
Invokes callback ApiListener.addBlockagePolygonResult().

◆ addListener()

static void de.infoware.android.mti.Api.addListener ( ApiListener  listener)
static

◆ customFunction()

final static native int de.infoware.android.mti.Api.customFunction ( String  param1,
String  param2 
)
static

Calls a custom function in MapTrip with two string parameters.

Parameters
param1- first parameter
param2- second parameter
Returns
Invokes callback ApiListener.customFunctionResult().

◆ deleteAllBlockages()

final static native int de.infoware.android.mti.Api.deleteAllBlockages ( boolean  persistent)
static

Deletes all blockages

Parameters
persistent- True: Delete only persistent blockages. False: Delete only non-persistent blockages
Returns
Invokes callback ApiListener.deleteAllBlockagesResult().

◆ deleteBlockageAt()

final static native int de.infoware.android.mti.Api.deleteBlockageAt ( int  blockNumber,
boolean  persistent 
)
static

Deletes all blockages

Parameters
persistent- True: Delete only persistent blockages. False: Delete only non-persistent blockages
Returns
Invokes callback ApiListener.deleteBlockageAtResult().

◆ deleteBlockageByID()

final static native int de.infoware.android.mti.Api.deleteBlockageByID ( String  ID,
boolean  persistent 
)
static

Deletes blockage at the given index

Parameters
blockNumber- Index of the blockage (0 .. blockage count -1)
persistent- True: Delete only persistent blockages. False: Delete only non-persistent blockages
Returns
Invokes callback ApiListener.deleteBlockageByIDResult().

◆ enableLogging()

final static native int de.infoware.android.mti.Api.enableLogging ( String  fileName,
int  logLevel,
int  fileSizeInBytes,
int  fileCount,
boolean  closeFileMode,
boolean  debugLogging 
)
static

Activates debug logging. A logfiles will be written in the path of the application execution.

Parameters
fileName- name of the log file
logLevel- Log all messages up to the given level ( 1 logs only critical errors, 999 logs everything )
fileSizeInBytes- Max size of the log file
fileCount- Max count of logfiles. If fileCount is reached, logging continues at the first file
closeFileMode- if true, every log entry will open and close the logfile so that no log is skipped (e.g. exception in application)
debugLogging- if true, the debug console will be used as log oputput instead of a file
Returns

◆ enableNetworkConnections()

final static native int de.infoware.android.mti.Api.enableNetworkConnections ( boolean  enable)
static

Enables or disables network connections.

Parameters
enableif false, all network connections from the SDK are disabled
Returns
Invokes callback ApiListener.enableNetworkConnectionsResult().

◆ findServer()

final static native int de.infoware.android.mti.Api.findServer ( )
static

This function can be used to ask if the server is still running.

Returns
Invokes callback ApiListener.findServerResult().

◆ getApiVersion()

final static native int de.infoware.android.mti.Api.getApiVersion ( )
static

Get the version of the current api used by the server.

Returns
Invokes callback Api.getApiVersionResult().

◆ getBlockageAt()

final static native int de.infoware.android.mti.Api.getBlockageAt ( int  blockNumber,
boolean  persistent 
)
static

Gets blockage information at the given index

Parameters
blockNumber- Index of the blockage (0 .. blockage count -1)
persistent- True: Get only persistent blockages. False: Get only non-persistent blockages
Returns
Invokes callback ApiListener.getBlockageAtResult().

◆ getBlockageCount()

final static native int de.infoware.android.mti.Api.getBlockageCount ( boolean  persistent)
static

Gets the number of blockages

Parameters
persistent- True: Count only persistent blockages. False: Count only non-persistent blockages
Returns
Invokes callback ApiListener.getBlockageCountResult().

◆ getDataUsageMonthlyLimit()

final static native int de.infoware.android.mti.Api.getDataUsageMonthlyLimit ( )
static

Get monthly network data limit.

Returns
Invokes callback ApiListener.getDataUsageMonthlyLimitResult().

◆ getDataUsageRemainingQuota()

final static native int de.infoware.android.mti.Api.getDataUsageRemainingQuota ( )
static

Get remaining quota before reaching the monthly network data limit.

Returns
Invokes callback ApiListener.getDataUsageRemainingQuotaResult().

◆ getMaptripVersion()

final static native int de.infoware.android.mti.Api.getMaptripVersion ( )
static

Get the version of the running maptrip instance.

Returns
Invokes callback ApiListener.getMaptripVersionResult().

◆ getMapVersion()

final static native int de.infoware.android.mti.Api.getMapVersion ( )
static

Get the version of the used map data. Format: "(maprelease) mapProvider".

Returns
Invokes callback ApiListener.getMapVersionResult().

◆ getSettingsParameter()

final static native int de.infoware.android.mti.Api.getSettingsParameter ( String  section,
String  parameter 
)
static

Requests a parameter in the MapTrip settings.ini. You receive the value of the requested parameter in the callback ApiListener.getSettingsParameter().

Parameters
section- section of the parameter
parameter- parameter to request
Returns
Invokes callback ApiListener.getSettingsParameter().

◆ hideServer()

final static native int de.infoware.android.mti.Api.hideServer ( )
static

This function can be used to request the Server application to minimize

Returns
Invokes callback ApiListener.hideServerResult().

◆ init()

final static native int de.infoware.android.mti.Api.init ( )
static

Initializes communication with the server. This should be the first call if you want to use the interface. The ApiListener.initResult() will be called as soon as the mti interface is initialized. For a successful initialization the server application has to run.

To receive an event if MapTrip has started or quit, register the ApiListener.infoMsg(). This can be done even before initialization.

A typical initialization scenario would cover the following steps:

Returns

◆ isNetworkConnectionEnabled()

final static native int de.infoware.android.mti.Api.isNetworkConnectionEnabled ( )
static

Checks, if network connections are enabled or disabled.

Returns
Invokes callback ApiListener.isNetworkConnectionEnabledResult().

◆ removeAllListeners()

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

◆ removeListener()

static void de.infoware.android.mti.Api.removeListener ( ApiListener  listener)
static

◆ resetDataUsageMonthlyLimit()

final static native int de.infoware.android.mti.Api.resetDataUsageMonthlyLimit ( )
static

Reset monthly network data limit.

Returns
Invokes callback ApiListener.resetDataUsageMonthlyLimitResult().

◆ sendText()

final static native int de.infoware.android.mti.Api.sendText ( String  text)
static

Sends a text to the server application which is displayed on the mapview. Text formatting can be done in the MapTrip configuration files (For adjustments modify the MainWindow.xml StatusTextControl for the desired resolution). To hide the text, send an empty string as text.

Parameters
text- Text that is printed on the map. Pass an empty string to hide a displayed text
Returns
Invokes callback ApiListener.sendTextResult().

◆ setDataUsageMonthlyLimit()

final static native int de.infoware.android.mti.Api.setDataUsageMonthlyLimit ( int  KBytes)
static

Set monthly network data limit.

Parameters
monthlydata limit in KB. Zero or negative value to disable limit.
Returns
Invokes callback ApiListener.setDataUsageMonthlyLimitResult().

◆ setSettingsParameter()

final static native int de.infoware.android.mti.Api.setSettingsParameter ( String  section,
String  parameter,
String  value 
)
static

Sets a parameter in the MapTrip settings.ini.

Parameters
section- section of the parameter to be changed
parameter- parameter to be changed
value- value for the parameter
Returns
Invokes callback ApiListener.setSettingsParameter().

◆ showApp()

final static native int de.infoware.android.mti.Api.showApp ( String  packageName,
String  activity 
)
static

Starts an activity.

Returns
Invokes callback ApiListener.showAppResult().

◆ showServer()

final static native int de.infoware.android.mti.Api.showServer ( )
static

This function can be used to request the Server application to maximize or minimize.

Returns
Invokes callback ApiListener.showServerResult().

◆ stopServer()

final static native int de.infoware.android.mti.Api.stopServer ( )
static

Requests the server application to shut down.

Returns
Invokes callback ApiListener.stopServerResult().

◆ uninit()

final static native int de.infoware.android.mti.Api.uninit ( )
static

Closes the communication channel to maptrip and frees internal resources used by the MTI.dll.

After a call to Api.uninit() no further infoMsg can be received. Re-register the callback to receive the Info.MAPTRIP_STARTED events again.

Blocking call

Returns