Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create turn-by-turn GPS navigation app on Android/iOS using Google Maps?

Today I've talked to a client and he wants to build a simple navigation APP on Android!

Basically we could use Google maps, place some of "our" markers to show some locations (restaurants, hotels etc.) .. also we need to show user's friends near by!

Everything of that is possible in Google Maps API on Android, except I can not find any useful information about Turn-by-turn navigation implementation inside my own app (without switching to Google Maps App) ..

Can someone simply clarify - is it possible to use Google Maps inside an Android app to create turn-by-turn GPS based app?

thanks

like image 586
mz87 Avatar asked Jul 02 '14 12:07

mz87


People also ask

Is it possible to embed Google navigation in an Android app?

Short answer: Yes (with a but). If you are asking about displaying a full Navigation experience with turn by turn instructions, a puck, routines on Google Maps, then the answer is: It's illegal to do it without Google's permission.


2 Answers

I agree with the answer stated above but there is also a key clause in section 10.4.c of the google maps API privacy terms here.

It states

No navigation. You will not use the Service or Content for or in connection with (a) real-time navigation or route guidance; or (b) automatic or autonomous vehicle control.

Therefore I'd like to proceed and answer your question and say No, it is not possible to create a turn-by-turn navigation application on android by using Google Maps API without breaching their privacy policy.

like image 147
Tushar Avatar answered Sep 19 '22 06:09

Tushar


Edit: Read answer by Tushar below before using this answer

First Option

If you want to implement the navigation completely in your app you will have to use a combination of the Google Maps API and the Google Directions API. They are free to use up to a limit and then you have to pay for the api requests.(https://developers.google.com/maps/documentation/directions/)

Second Option

I would just send the latitude and longitude of the location you want to navigate to the devices Maps app. Here is some code to start you off with this method:

double lat = < latitude of the location you want to navigate to>  double lng = < longitude of the location you want to navigate to>       String format = "geo:0,0?q=" + lat + "," + lng + "( Location title)";  Uri uri = Uri.parse(format);    Intent intent = new Intent(Intent.ACTION_VIEW, uri); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); 

This will open the device's Maps app and plot the location and the user can use the app to do what ever they want.

I would go with the Second Option, it is stupidly easy to implement.

like image 23
DrkStr Avatar answered Sep 21 '22 06:09

DrkStr