alvan alvan - 11 months ago 43
Android Question

How can I update user's position quickly on Google Map in Android?

I am working on an app recently, and I need to show user's position on the Google Map.

According to the material I found on the internet and with the help of API.
Now I can show the phone's position and mark it.

Currently I use the code below to obtain the location

locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000,0, this);
public void onLocationChanged(Location location) {
currentLocation = location;

GeoPoint geo = new GeoPoint(((int)location.getLatitude()*1E6),

I guess this method would call the
onLocationChanged(Location location)
method every second?

It turns out, the location is detected every 15 sec. But I need to update the location information ASAP.

Answer Source