2

I'm developing an app and I need to intent from my app to installed navigation apps. Found some useful resources but they are not useful for my approach.

Launching Google Maps Directions via an intent on Android

  • This example only works with Google Navigation

Intent to start a navigation activity

  • This example is not working

My whole aim is; imagine one person's smartphone s/he have yandex navi, google maps and sygic navi. When I click to navigation button on the developed app, this app prompt user to select an application for navigation.

How can I do this

Thanks

Community
  • 1
  • 1
salih
  • 727
  • 13
  • 36

1 Answers1

2

For now, I will start with the idea of using Intent and let the Android framework offer the choice to users by an appropriate prompt. For a start, look at Google link @ Google Maps API. A difference is that I would not call setPackage(). Suggested code:

Uri gmmIntentUri = Uri.parse("geo:37.7749,-122.4194");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
startActivity(mapIntent);

Notes:

  • setPackage() is not called.
  • Uri.parse() is using sample coordinates.
The Original Android
  • 6,147
  • 3
  • 26
  • 31