Android Question TomTom Intent

Calum Forsyth

Member
Licensed User
Hi All,

I would like to start the navigation app on the TomTom Bridge, passing an itinerary file. I have the android version of the code but i'm unsure how to fully implement it into B4A.

The android code is:

B4X:
private void importSingleRouteToNavigation(finalFile importfile)throwsIOException{
    finalUri fileUri = Uri.fromFile(importfile);
    finalIntent importToNavigationIntent = newIntent();
    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);
}

accessible here http://developer.tomtom.com/products/bridge/develop

So far my code is:
B4X:
Dim pm As PackageManager
Dim routeIntent As Intent = pm.GetApplicationIntent("tomtom.intent.action.IMPORT_SINGLE_ROUTE")
routeIntent.PutExtra("android.intent.extra.STREAM", "")
routeIntent.SetType("application/gpx")
StartActivity(routeIntent)

Thank You
 

Calum Forsyth

Member
Licensed User
Something like:
B4X:
Dim in As Intent
in.Initialize("tomtom.intent.action.IMPORT_SINGLE_ROUTE", "")
Dim fileUri As Url 'content resolver library
fileUri.Parse("file://" & File.Combine(...))
in.PutExtra("android.intent.extra.STREAM", fileUri)
in.SetType("application/gps")
in.Flags = 1
StartActivity(in)

I will try it, Thanks Erel.
 
Upvote 0
Top