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

Static Public Member Functions

static void copyFile (File file, String destination)
 
static void deleteFile (String file)
 

Member Function Documentation

◆ copyFile()

static void de.infoware.android.mti.MTIFile.copyFile ( File  file,
String  destination 
)
static

Since Android 11 apps have limited access to files from other apps. Especially if you like to start a FollowMe route (FollowMeRoute#startFollowGpsPath) or a reference route (Navigation#startReferenceRoute) with a file stored in the storage of your app, MapTrip has no access to this file. With this method you can copy a file from the storage of you app to the external files storage of MapTrip. As the result of calling this function, the callback ApiListener#infoMsg is fired with messageType = Info#COPY_FILE. If param is 0 the file could be copied successfully. Otherwise the file could not be copied. Your app needs to be in foreground, if you call this method. After a call of this method the MapTrip app will go into the foreground.

Parameters
file- the file that you like to copy to the external storage of MapTrip, your app must have access to that file.
destination- relative path including filename where the file should be stored in the MapTrip external storage. For example "/mti_test/test.nmea" will store you file at "/sdcard/Android/data/de.infoware.maptrip.navi.license/files/mti_test/test.nmea". The file location depends on the used MapTrip App.

◆ deleteFile()

static void de.infoware.android.mti.MTIFile.deleteFile ( String  file)
static

With this method you can delete a file from the external storage of the MapTrip app. As the result of calling this function, the callback ApiListener#infoMsg is fired with messageType = Info#DELETE_FILE. If param is 0 the file could be deleted successfully. Otherwise the file could not be deleted.

Parameters
file- the file to be to deleted