Android Question Google maps route

Discussion in 'Android Questions' started by AHilberink, Apr 10, 2019.

  1. AHilberink

    AHilberink Active Member Licensed 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é
     
  2. DonManfred

    DonManfred Expert Licensed User

    Code:
    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

    Code:
    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
     
    Erel, mangojack and AHilberink like this.
  3. AHilberink

    AHilberink Active Member Licensed User

    Hi Manfred,

    Thanks a lot. This does the job.

    Best regards,
    André
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice