Sorry, you need to enable JavaScript to visit this website.

NavApp SDK

TomTom BRIDGE is Android

A TomTom BRIDGE device is a 'standard' Android device, currently running Marshmallow 6.0, API level 23. Minimal platform changes were done to improve the in-car experience, which means that a TomTom BRIDGE, by and large, remains an Android device. Any apps that you can run on other Android platforms, will run on TomTom BRIDGE as well, so you are free to embellish the TomTom BRIDGE experience with APKs of your own making, or any third party applications that your customers / users would find useful.

There is one notable expection to this: the launcher application. To provide as much power as possible to the user on their home screen, TomTom integrated its widgets directly into the default launcher. If you would like to use another launcher, be aware that the "Navigation" and "External camera" widgets will not be available to you.

The TomTom BRIDGE SDK offers seamless integration of TomTom solutions with any business application to help companies achieve their efficiency goals.

The SDK contains NavApp SDK and Map Library SDK which will enable you to integrate your business applications with TomTom's advanced navigation software. They are designed for ease of use: just add the SDKs to your application project and start navigating from within your own app. The SDKs are initialised through a single API call as well as most of the navigation API functions.

NavApp SDK

 

The SDK can be downloaded from the Downloads section of this portal.

NavApp SDK javadoc documentation

NavApp SDK - interfacing to navigation

Installing the SDK

Copy the navappclient.jar file into your application project libs directory. The file can be found in the SDK which you downloaded from the portal.

Initialising the SDK

The NavApp SDK consists of a group of interfaces accessed through the NavAppClient class.

To use the NavApp SDK you need to create an instance of the NavAppClient, using the NavAppClient.Factory.make(Context, ErrorCallback) method.
The returned instance is used to access the individual APIs.

As instantiating the NavAppClient requires some background initialization, the NavAppClient is preferably created once per application, e.g. in the Activity onCreate callback.
Once this call returns the NavAppClient instance is ready to use.

protected void onCreate(final Bundle savedInstanceState) {
     // Instantiate the NavAppClient passing in a Context.
     mNavappClient = NavAppClient.Factory.make(this, mErrorCallback);
}

private final ErrorCallback mErrorCallback = new ErrorCallback() {
    @Override
    public void onError(final NavAppError error) {
        Log.e(TAG, "onError(" + error.getErrorMessage() + ")\n" + error.getStackTraceString());
        mNavappClient = null;
    }
};

And should be closed in the Activity onDestroy callback, using NavAppClient.close()

protected void onDestroy() {
    mNavappClient.close();
}

Using the API

The NavAppClient instance can then be used to access the APIs.

Retrieving information about the map

Note: any callback from the SDK will be done on the UI Thread.
Note: all APIs will throw an IllegalArgumentException if the listener argument is null.

mSDKUtils = mNavappClient.getUtils();
mSDKUtils.getMapInfo(mMapInfoListener);

private MapInfo.Listener mMapInfoListener = new MapInfo.Listener() {
    public void onMapInfo(final MapInfo mapInfo) {
         Log.d(TAG, "name: " + mapInfo.getName() +
             "releaseNumber: " + mapInfo.getReleaseNumber() +
             "releaseDate: " + mapInfo.getReleaseDate() +
             "buildNumber: " + mapInfo.getBuildNumber() +
             "locationPath: " + mapInfo.getLocationPath());
 }
};

Planning a trip

mTripManager = mNavappClient.getTripManager();

final Routeable destination = mNavappClient.makeRouteable(DESTINATION_LATITUDE, DESTINATION_LONGITUDE);
mTripManager.planTrip(destination, mPlanListener);

private Trip.PlanListener mPlanListener = new Trip.PlanListener() {
    public void onTripPlanResult(final PlanResult result) {
         Log.d(TAG, "onTripPlanResult result[" + result + "]");
    }
};

Map Library SDK

The SDK can be downloaded from the downloads section of this portal.

For information on how to use the SDKs, please visit the pages containing example code: Map Library SDK

Importing and Exporting Routes

Importing routes into Navigation

The Navigation application handles the intent ACTION_SEND and ACTION_SEND_MULTIPLE, with mime types "application/gpx" and "application/itn". This is useful if you want to import Routes directly into the Navigation Application from a File Explorer. However, if you want to import into Navigation, Routes from your application, you can do it one at a time, using the following intent.

For single .gpx or .itn file: tomtom.intent.action.IMPORT_SINGLE_ROUTE

The mime types are "application/gpx" and "application/itn", for .gpx and .itn files respectively. The following is an example to import .gpx Routes to Navigation from an external application.

Importing single Route to Navigation

private void importSingleRouteToNavigation(final File importfile) throws IOException {
        final Uri fileUri = Uri.fromFile(importfile);
        final Intent importToNavigationIntent = new Intent();
        importToNavigationIntent.setAction("tomtom.intent.action.IMPORT_SINGLE_ROUTE");
        importToNavigationIntent.putExtra(Intent.EXTRA_STREAM, fileUri).setType("application/gpx").setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        importToNavigationIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
        startActivity(importToNavigationIntent);     
    }

To share routes from your application's internal data files, use FileProvider. Routes imported into Navigation, can be found in the "My Routes" screen, in the Main Menu.

Exporting routes and Saving Routes to device

All the Routes (both .gpx files and .itn files) appear on the "My Routes" screen. Only the .gpx Routes can be exported to another application or saved to device from the "My Routes" screen.

  • Indicates the itinerary files (.itn), which cannot be exported
  • Indicates the route files (.gpx), which can be exported

The routes to be exported can be selected by choosing "Export Tracks" on the contextual menu on the "My Routes" screen.

Exporting .gpx routes from My Routes

Selecting Routes to export

When a route or multiple routes are exported, you are presented with an option to send it to a an application that handles the route files. To save the route on the device, send the routes to "Save to device" application. This will save the selected routes in the Routes folder internally.

Saving routes to device

If you want to send the route files to your own application, then your application must handle the ACTION_SEND and ACTION_SEND_MULTIPLE intents, with mine type "application/gpx".

Intent filters in manifest file

<intent-filter>
    <action android:name="android.intent.action.SEND" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="application/gpx" />
</intent-filter>
            
<intent-filter>
    <action android:name="android.intent.action.SEND_MULTIPLE" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:mimeType="application/gpx" />
</intent-filter>

The route files can then be retrieved from the intent, as shown in the example below.

Retrieving route files from intent

final ArrayList uriList = new ArrayList()
if (Intent.ACTION_SEND.equals(intent.getAction())) {
    final Uri uri = (Uri) intent.getExtras().get(Intent.EXTRA_STREAM);
    uriList.add(uri);
} 
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && Intent.ACTION_SEND_MULTIPLE.equals(intent.getAction())) {
  try {
    final ClipData clipData = intent.getClipData();
      if (clipData != null) {
        final Integer itemCount = (Integer) clipData.getItemCount();
        for (int i = 0; i < itemCount.intValue(); i++) {
        final Item clipDataItem = clipData.getItemAt(i);
        if (clipDataItem != null) {
          uriList.add(clipDataItem.getUri());
        }
      }
    }
  }
  catch (final IllegalArgumentException e) {
    if (Log.E) Log.e(TAG, e.getMessage());
  }
}

Generating inputstream from file uri

final ParcelFileDescriptor inputPFD = mContentResolver.openFileDescriptor(uri, "r");
final FileDescriptor fd = inputPFD.getFileDescriptor();
FileInputStream  inputStream = new FileInputStream(fd);

Recording new Routes

New routes can be created in the Navigation application, by using the "Start Recording" option on your Main Menu. When the recording starts, you can see a red dot on your Navigation screen.

To stop the recording, go back to the Main Menu and select the "Stop Recording" option. Routes created this way, are listed in the "My Routes" screen in .gpx format. As such, they can be exported to another application or saved to the device.

Remove speed limit indication

By default, Bridge will show the current vehicle speed and speed limit in the Navigation app, provided the map contains that information for the current road. If you wish to hide these from the user, you can install the "disable speed info" package. Add the following to your configuration:

{ "name": "disable-speed-info", "path": "disable-speed-info_1.0_all.ttpkg", "version": "1.0" }

And make sure that the package, found in the extra-packages.zip on the releases page, can be reached by your configuration.