Check if user not following the route in Android Google Maps - android

I am working an application where user need to develop turn by turn navigation.
I have developed this by using this link
Now this gives me route and very good turn by turn navigation.
But my question is suppose if the user has missed the turn and he takes other turn then how would I come to know that user is not on the path specified?
Need help in this regard.
Thanks in advance

The directions gives you the whole distance of the route, you can check if this distance is increasing, this means he is going on the wrong route which is also not so efficient solution but I can't see any other way to do it unless Google provides directions & navigation in Android Google Maps SDK.

Related

What kind of settings/method calls will get me geolocation accuracy close to Google Maps?

I've developed a hybrid app that collects GPS points using a plugin (this one, to be precise). The thing is, when users are on a remote location, with little GPS/network coverage, we've had to resort to opening Google Maps in the background and then using the app in order to get a good coordinate. Otherwise, it doesn't work too well.
I would like to eliminate the need for doing that, but feel at a loss about what kind of practices do apps like Google Maps or Waze do to get better geolocations. Is there a code base that I could study, or some documentation?
Thanks in advance!
You may check here. It is GitHub from Google Devs and they show how they handle location. Also, you can find other examples there

Can you embed a google map into an app with get voice directions?

Simple question, and I think i may already know that the answer is that I cannot do what I want but i can't find confirmation of it. I want a google map in voice guided turn by turn directions mode inside of an activity within my app. It seems like that can be done through their API, but I can't confirm or find whether that can include the voice guided feature and without that, it's not very valuable and I might as well launch the installed google maps app itself and have it skip the default activity and go right into the turn by turn mode with voice rather than embedding it in my activity. I have already done that but would rather have it inside of an activity in my app. Does anybody know for sure if voice guided is offered other than through the installed maps app? Also, any creative ideas or workarounds would be gladly appreciated as well. Thank you.
No.
It's not directly supported by the Google Maps API. You could theoretically cobble it together yourself, using the Directions API and TTS, but the main reason you can't do this is legal rather than technical. From the Google Maps APIs Terms of Service:
10.4.c.iii No navigation. You will not use the Service or Content for or in connection with (a) real-time navigation or route guidance; ...

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

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.

Obtaining deviations from set google maps route?

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.

Android GPS navigation between 2 points

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.

Categories

Resources