I want to get periodic (say every 2 minutes) current location updates for this I\'m following official documentation, I wrote this code but its not giving current location u
private LocationRequest locationRequest;
public class MapsActivity extends FragmentActivity implements LocationListener{
locationRequest = new LocationRequest();
locationRequest.setInterval(60 * 1000);
locationRequest.setFastestInterval(15 * 1000);
locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
@Override
public void onLocationChanged(Location location) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
Implement Location change listener and you will be able to override onlocation changed...