1

We know the code for open the google navigation is

Uri gmmIntentUri = Uri.parse("google.navigation:q=Taronga+Zoo,+Sydney+Australia");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);

but my questions are:

  1. Is it possible to close it when the user reaches his destination? (return to my app)

  2. Is it possible to add other destination when users reaches his destination? For example, when I open the intent I give a coordinates. But I want if he has the coordinates, I want to give it some new coordinates (others words when open the app give coordinates of point A when users is in point A give him coordinates of point B when he is in Point B give him coordinates of point C). (Maybe with a service running in foreground)

  3. Is it possible to do all previous inside my app (maybe using Google Api for android) or is the only way opening the navigation app? (I'll prefer to have it inside my app and I believe controls actions would be easier.)

abielita
  • 13,147
  • 2
  • 17
  • 59
angel
  • 4,474
  • 12
  • 57
  • 89

1 Answers1

0
  1. You can use Geofence API from Google to detect that the user location entered and stayed in the final LatLng, than from GeofenseIntentService you could send a notification to redirect to your App or try to open it. Geofence Google Sample
  2. You can fire again the Navigation Intent with the new LatLng values from GeofenseIntentService when it detects user reached the geofence radius
  3. No, there is no way to use google navigation in your app. You could try to use HERE maps and these sdk:https://stackoverflow.com/a/22007961/4683601
Community
  • 1
  • 1
Ely Dantas
  • 705
  • 11
  • 23