How to update my current location from GPS
I got the current location from GPS with the following method,
i want to update the my current location
any body help me how to do it
// method to get current location from gps
public void gotoCurrentGPSPosition() {
bubbleIcon = BitmapFactory.decodeResource(getResources(),
R.drawable.bubble);
shadowIcon = BitmapFactory.decodeResource(getResources(),
R.drawable.shadow);
this.myLocationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
mMapView = new MapView(this);
MapController mc = mMapView.getController();
currentGPSLocationOfPhone =
myLocationManager.getCurrentLocation("gps");
// Create a Point that represents our GPS-Location
Double lat = this.currentGPSLocationOfPhone.getLatitude() *
1E6;
Double lng = this.currentGPSLocationOfPhone.getLongitude() *
1E6;
// My gps location
point = new Point(lat.intValue(), lng.intValue());
MapLocationOverlay mylocation = new MapLocationOverlay();
OverlayController overlaycontrol =
mMapView.createOverlayController();
overlaycontrol.add(mylocation, true);
// mc.setFollowMyLocation(true);
mc.animateTo(point);
mc.zoomTo(21);
mMapView.toggleSatellite();
setContentView(mMapView);
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---