Can anyone point me in the direction of a tutorial on how to use GPS (Google maps) to navigate between 2 points in an Android app. I have searched for the last few hours and can only find
tutorials on pinpointing current location.
What I need to do is show current position on map, and then navigation to a set destination on map. So e.g. you are at point A - navigate to point Z
EDIT: Sorry but I should have clarified. What I want to do is just have a button in the app that the user clicks. Once clicked, Google Maps app open and from here Google can do the rest. I don't need the map to be displayed in my app at all.
There is no easy way to do it, you will need to get the direction from a location API such as Google Directions API or Cloudmade to give you all the way points between your 2 points.
you then however have to plot the path and then handle the voice controls yourself
you can however use and Intent to launch the google navigation app in the google maps app and just have google maps do everything but that does not sound like what you want
You can use a VIEW intent using standard google maps parameters. If Google Maps is installed on the device, the user will be able to choose to open it using that or the default browser, etc.
Unfortunately, there's no way to do this directly with a geo: intent at this time. In any of my mapping applications, I've given up bothering with geo: because it's just not mature or standardized enough.
For a great list of url parameters to use(including "directions" mode), check out Everything You Never Wanted to Know About Google Maps' Parameters. I keep it bookmarked.
Related
I'm building a website with a button. When I hit the button on a tablet or smartphone the google maps android app should be starting with a direction, which is set on the website.
With one source and one destination address it's not a problem. For this I can use:
google.navigation:q=latitude,longitude
Link
But I need to start the navigation with multiple waypoints.
Is there also a possiblity to do this?
You mean a list of waypoints like this:
Here is the link to the sample
I am making my first android app to track and manage medications.
One of the features I want to include is adding a page that says '"Find Local Pharmacies'.
What I want is very simple - when the user opens this page I want a map to appear with pins on all the places that matched the term 'pharmacy' (within say a 5km radius).
I have never used Google Maps API before so I don't know if this sort of thing is even possible - online searches suggest Google doesn't have a 'search' API, but is there any easy way to do this?
Thanks!
One option would be to use the Google Places API. I see they've got a place type of "pharmacy".
I have an app which opens Google Maps from where the user is likely to start the Google Navigation from point A to B. Is it possible to open Google Maps and therefore Google Navigation only in specific proportion of the screen and display some additional (but minimal) information from my app next to the navigation?
I am thinking of something like this:
Additionally, is it possible to receive a broadcast when during the Google Navigation the user has arrived to her destination?
I know it is a bit far fetched, but maybe there are some ideas.
If you are still interested in knowing about this after 2 years.
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. If you look at the Lyft app for drivers, they do have a full navigation experience on top of Google Maps because they partnered with them. So, it's possible, but requires direct communication with Google engineers.
For a workaround, you could show an embed Google Maps view in your apps, and show Markers, Polylines. They also have these APIs to get directions from one place to the other one. For example:
https://maps.googleapis.com/maps/api/directions/json?origin=Disneyland&destination=Universal+Studios+Hollywood4&key=<YOUR_API_KEY>
NOTE: Fees will apply when using these APIs. Check their documentation for more details about the workaround.
You can but you need to contact google personally this is google explanations about this subject and the contract page specially for your request https://cloud.google.com/maps-platform/ridesharing/
Not directly from Google map's navigation . But you can create your own by using
Direction API.
https://developers.google.com/maps/documentation/directions/start#sample-request
yes ,
you can use point an geography point by polygone and line canvas for routing the path between two point on google map.
for more reference reffer this Link.
We would have all used the google maps app on android, so my question is little relevant to that.
In the gmaps for android app, when I choose a driving route, the route gets displayed on the map with voice and text commands. Suppose I deviate from that path, it recalculates the route and alerts me saying follow the original route.
So my question is, can we do this in the google maps API that is provided for android in our own app? If so what is the best followed approach.
My use case goes like this: I have a user who will start his journey to a set of client hotels, and if the transit he takes deviates I simply have to alert him saying he is following a wrong route or he has to follow the modified route. Kind of a security feature.
I am looking to integrate Directions between a Lat, Long and the present location of the User. I would want at the click of the button to direct the user to the installed Google Maps/ Other Apps and show the directions.
I search SO and Google but couldn't find a good source and hence am posting this Question.
Tour Bangalore seems to be able to do it.
Couldnt find documentation on how to achieve this
There is no documented and supported Intent structure for this, sorry. You can bring up a map on a point, but not force Maps to obtain directions.
Also, bear in mind that:
not all devices have Google Maps
the user might not want to use Google Maps, even if it is installed (e.g., they bought some third-party mapping app that they wish to use)
The only official intents documented are given here. They do not include directions.
It has been noted that the following intent structure works with Google Maps. It seems the current Google Maps ingests the google maps http requests. It is probably the method used by the apps you've seen. However, it likely only works with Google Maps, and since it appears to be undocumented, there is no guarantee it will continue to work with future version of Google Maps.
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse("http://maps.google.com/maps?daddr=33.881894,-92.199623&saddr=My+Location"));
where daddr is the destination location, and saddr is the source location. They can either be lat/lng's or search terms. "My+Location" is a search term in the above example, so it unlikely to work in locales with a language other than English.