Android Question Google map to start navigation and get eta?

tsteward

Well-Known Member
Licensed User
Longtime User
I've searched high and low and don't understand most of it.
I want to send an address to Google Maps and start navigation and determine the ETA so I can record the ETA,

I figure this has been done before and hoping someone can show me the way.
 

tsteward

Well-Known Member
Licensed User
Longtime User
Starting maps and navigating I have found can be done as below But I still need a way to get the ETA or travel time for the route
B4X:
Private Sub ButtonStart_Click
    ' Handle button click event to navigate using Google Maps
    Dim address As String = $"${B4XFTStreeNo.Text} ${B4XFTStreet.Text} ${B4XFSuburb.Text} ${B4XFTState.Text}"$ ' Specify your desired address here

    ' Open Google Maps with navigation to the specified address
    Dim pIntent As PhoneIntents
    StartActivity (pIntent.OpenBrowser ("https://www.google.com/maps/dir/?api=1&destination=" & UriEncode(address) & "&travelmode=driving") )
    
End Sub

Sub UriEncode(s As String) As String
    ' Function to encode the address string for URL
    Dim su As StringUtils
    Return su.EncodeUrl(s, "UTF8")
End Sub
 
Upvote 0
Top