Gps schmeePS

implements LocationListener

LocatonManager newLocation;

Geocoder geo;

Location loc;

OnCreate{

locationManager =(LocationManager) getSystemService(LOCATION_SERVICE);
geocoder = new Geocoder(this);
Location LastLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if(LastLocation != null)
{
onLocationChanged(LastLocation);
}

@Override
public void onLocationChanged(Location location) {
String text = String.format(“Lat:\t %f\nAlt:\t %f\nBearing:\t %f”,location.getLatitude(),location.getLongitude(), location.getAltitude(),location.getBearing());
/// editLocation.setText(text);

try{
List<Address> addresses = geocoder.getFromLocation(location.getLatitude(),location.getLongitude(), 10);
}
catch(IOException e){
e.printStackTrace();
}

}
}

Hope this helps someone in last minute need of GPS!