B4A Library CalculationDistanceTime - Calculate distance and time on the road

Hi all.
This is a new library to calculate the distance (kilometers or miles) and time from the source point to the point of arrival by calculating and keeping presenting the traffic and the fastest route. Of course traffic data, accidents, etc. They are calculated in real time.
You have two ways to use Google API or to use this library ( use Google API )
In this way you can get this for example:


Use is very simple:

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Dim calculate As calculationdistancetime
    calculate.Initialize(41.923229,12.7241383,41.9191877,12.655384, "Km", Me, "Check_Result")

End Sub

Sub Check_Result(valore As typeLevel)
    Log("Errore: " & valore.error)
    If valore.error.Length = 0 Then
        Log("Distance: " & valore.distance)
        Log("Time to Arrive: " & valore.duration)
    End If
End Sub

The library is not free. You need to donate 10€ to get the library.
YES IS FREE :p:D:p. But anyway if you want dont forget a little Donation


  • Library-CalculationDistanceTime.zip
    4.6 KB · Views: 491
Last edited:

Situ LLC

Active Member
Licensed User
Verry good Marco
Where I have to put my API key
I will donate excellent work

"destination_addresses" : [],
"error_message" : "You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account",
"origin_addresses" : [],
"rows" : [],
"status" : "REQUEST_DENIED"