Tag: google-maps

Set Location Center of Map – GMaps v2 – Android

How do I set the center of the map to a specific location using GMaps v2? This is how I did it using GMaps v1: public void setCenter( LatLng point ) { if( point.latitude*1000000 != 0 && point.longitude*1000000 != 0 ) { if( mMapController != null ) { mMapController.setCenter( point ); } /*else if( mOpenStreetMapViewControllerSource […]

how to show markers all the time by AsyncTask or Handler in google map version 2

The final thing I am doing is: I have the google map in my application with som buttons and extra stuffs. but I also have to show the updated location of a marker all the time inside my map (I will get the data from external device not gps sensor of android phone). So I […]


I’m trying to use Android Maps, following the instructions in Hello MapView. I’ve added <uses-library android:name=”com.google.android.maps” /> in the Manifest, and I’m building against the ‘Google APIs’ target, which claims to be API version 7. So I don’t think I’m doing anything obviously wrong, but the project refuses to build with this error: [2010-12-22 13:34:32 […]

How do I close out of Google Navigation programmatically?

I am starting Google Navigation through an Intent: private static final int GOOGLE_NAV = 5; Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(“google.navigation:q= some + address”)); startActivityForResult(intent,GOOGLE_NAV); I then check if the user has reached his destination via a LocationListener. If the user has arrived, I want to close the Google Navigation activity. if(hasArrived()) { finishActivity(GOOGLE_NAV); } […]

how to move camra to a specific marker in google maps v2 in android

I am able to display a marker as well as showing it with zoom and camera setting when first time user is viewing the map. But my requirement is to move the camera to same marker position(when user want) if user goes away from that marker position(marker gets off-screen) during his/her visit.

How to specify the size of the icon on the Marker in Google Maps V2 Android

In may app i use Map from Google Maps V2 and in this map i am trying to add markers each Marker with an icon, but the marker is taking the size of the icon which is making the icon looks flue. How can i specify the size of the marker in dp so that […]

Center a map marker in Android

I use the following code to display a single marker at a zoom level but it doesn’t center tha marker on the map. Only one marker will ever be shown: LatLng latLng = new LatLng(Latitude, Longitude); cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 11.0f); This code will center it but it doesn’t provide any zoom: LatLngBounds bounds = latLngBuilder.build(); […]

Android Google Maps v2 not showing Compass and Location Icon

I am not able to show the compass icon and the my location icon either. I have the code googleMap.getUiSettings.setMyLocationButtonEnabled(true) and googleMap.getUiSettings().setCompassEnabled(true); but it is not showing on the maps. package com.ctc.weathermap; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.MapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.location.Location; import android.location.LocationListener; import […]

Android: access saved google locations programmatically

Google maps allows the possibility of saving favourite locations for ease of access later… see here. In Android, where a location is required to be entered, it would be neat if there were an API to enable the user to choose from their already-saved favourite locations, e.g. via a picker dialog or something along those […]

Filling Color in polygon while points intersecting in Android

I am trying to draw a polygon using hand on google map and then filling the color to the polygon. Normally the color is filling fine and working as expected but if the polygon has intercepting point then the fill color is not working. I am using below code to draw polygon and fill the […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.