Android Question Google maps route

AHilberink

Active Member
Licensed User
Longtime User
Hi,

I want to try to integrate GoogleMaps for the use of routeplanning. I am on LatLonA and I want to LatLonB. When it's possible: Starting the default GoogleMapsApp is also fine.

Is this possible using one of GoogleMaps libraries and which one?

Best regards,
André
 

DonManfred

Expert
Licensed User
Longtime User
Starting the default GoogleMapsApp is also fine.
B4X:
    Dim mapIntent As Intent
    Dim geouri As String = "google.navigation:q=Triererstrasse 36, Aachen" ' Route to address
    mapIntent.Initialize(mapIntent.ACTION_VIEW,geouri)
    mapIntent.WrapAsIntentChooser("Please choose App")
    StartActivity(mapIntent)

or

B4X:
Dim in As Intent
   in.Initialize(in.ACTION_VIEW, $"google.navigation:q=${Latitude},${Longitude}"$)
   in.SetPackage("com.google.android.apps.maps") 'this method is only available in v8.8+. Example of calling it with JavaObject: https://www.b4x.com/android/forum/threads/inline-java-question.97866/#post-616946
   StartActivity(in)
End Sub
 
Upvote 0

AHilberink

Active Member
Licensed User
Longtime User

Hi Manfred,

Thanks a lot. This does the job.

Best regards,
André
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…