I am using this given below code to get locations:
public Location getLocation() { try { mLocationManager = (LocationManager) context.get
there are better ways to do it as mentioned on android developer sites http://developer.android.com/guide/topics/location/strategies.html