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
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With