This isn't bad. The official Android SDK on this matter is actually pretty good. Official Google Documentation on it
Basically the interface it uses runs functions as each one of these situations arises. So, onLocationChanged gets called whenever the location changes according to whatever parameter fires that off. Also, I would recommend just playing with the different provider types
The hardest part is the distance part. There's equations out there to calculate distance using longitude and latitudes.
From the documentation:
// Acquire a reference to the system Location Manager
LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
// Define a listener that responds to location updates
LocationListener locationListener = new LocationListener() {
public void onLocationChanged(Location location) {
// Called when a new location is found by the network location provider.
makeUseOfNewLocation(location);
}
public void onStatusChanged(String provider, int status, Bundle extras) {}
public void onProviderEnabled(String provider) {}
public void onProviderDisabled(String provider) {}
};
// Register the listener with the Location Manager to receive location updates
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);