Android Tutorial google map what intent

NJDude

Expert
Licensed User
Longtime User
You could get the position using the GPS and then pass that to the Google Maps apps like this:
B4X:
Dim MapIntent As Intent
                        
Location = "geo:0,0?q=" & "40.7142, -74.0064"
      
MapIntent.Initialize(MapIntent.ACTION_VIEW, Location)
      
StartActivity(MapIntent)
 

gapi

Active Member
Licensed User
Longtime User
thanks NJDude but I haven't latitude and longitude, I only address, city and zipcode ...
 

elck

Member
Licensed User
Longtime User
Great Warwound, thanks!
Are there any parameters that the Google Maps App accepts ( a bit like the static maps that you explained elsewhere?) when used in an intent as demonstrated above?
 

rboeck

Well-Known Member
Licensed User
Longtime User
Hi,

in an app i want let the user choose, if he want's to use google maps or maybe sometime google earth. For now i have managed to start google earth with the following code:

Dim Intent1 As Intent
Dim a As String

a= "geo:" & LatS2 & "," & LongS2
Intent1.Initialize(Intent1.ACTION_VIEW,a )
Intent1.SetComponent("com.google.earth/.EarthActivity")
StartActivity(Intent1)

Because there is no zoom, i dont know, if the position is ok; has anybody more luck to control google earth like google maps?

Greetings,
Reinhard
 

warwound

Expert
Licensed User
Longtime User
Anyone reading this thread might be interested to read about the Google Play Services version 6.5 update that is due to be released anytime now: http://android-developers.blogspot.co.uk/2014/11/google-play-services-65.html.

We’re also exposing the Google Maps for Android app intents available to your apps including displaying the map, searching, starting turn by turn navigation, and opening Street View so you can build upon the familiar and powerful maps already available on the device.
 
Top