PTV Navigator Remote Interface Documentation
Variables

Load preferences from a file

Variables

final int MSG_RI_LOAD_PREFERENCES = 129

Detailed Description

Load an import_preferences.xml file from an external directory

Loads a preference file from an external directory, copies it to the files directory of the Navigator (normally located under /sdcard/Android/data/com.ptvag.navigation.app/files/) and imports it's values to the navigator.
A file with the same name in the files directory will be overwritten by this function.
The file name can be arbitrary.
Attention: The client software must use a FileProvider to grant access to the file.

Loading a file is done by using the android FileProvider class to be able to grant the foreign navigator app access to files of this client (needed for Android 10/11). The steps to grant a permission is as following:

<provider android:name="androidx.core.content.FileProvider" android:authorities="com.ptvag.navigation.ritest.fileprovider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths" /> </provider>

For more implementation details, please see the RITest demo app.

Sending bundle:

KeyValueType

Info

FileName The name of the preference file with path as uri String

Returned error codes:

RI_ERROR_NONE if everything is ok.
RI_ERROR_RI_DISABLED if the Remote Interface service is disabled and/or not licensed.
RI_ERROR_NOT_INITIALIZED if the Remote Interface service is not initialized yet.
RI_ERROR_FILE_ACCESS if the file could not be loaded (either because of not granted permissions or of other load error).
RI_ERROR_NO_LICENSE if the navigator has no valid license.


© PTV Group 2023 Generated on Tue Dec 5 2023 14:56:26 for PTV Navigator Remote Interface Documentation by doxygen 1.7.3