I was looking for an answer using Google and here, and the only relevant posts I have found are:
Google Maps Android V2 and Direction API
Get driving directions using Google Maps API v2
but there is no answer there. So I have already mentioned it but I will say that again. I am looking for a solution for the Google Map API v2 using FragmentActivity and a SupportMagFragment and LatLng objects and not using MapView ,MapActivity and GeoPoint.
In addition I don't have the Overlay object to use so I can't paint the direction on the map, is there an alternative for that?
So is there a way to do that?
Go to the Google Maps Platform > Credentials page. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key. Click Close.
For direction calculations that respond in real time to user input (for example, within a user interface element), you can use the Directions API or, if you're using the Maps JavaScript API, use the Directions service . For server-side use, you can use Java Client, Python Client, Go Client and Node.js Client for Google Maps Services.
For Google Maps Platform Premium Plan customers who transitioned to pay-as-you-go pricing, the feature remains active. The Roads API is available with the Java Client, Python Client, Go Client and Node.js Client for Google Maps Services.
Next, while still logged into the GCP Console, go to the project you just created and enable the Directions API. Once that's done, go to the Google Maps Platform > Credentials page and generate a new API key (see this video for a step by step walkthrough).
This interpretation may result in severe detours on the route or ZERO_RESULTS in the response status code if the Directions API is unable to create directions through that point. The following URL requests waypoints using latitude/longitude coordinates:
Try this solution here. You can get driving or walking direction on V2.
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