package com.marakana;

import gov.sandia.R;
import android.app.Activity;
import android.location.Geocoder;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.TextView;

public class WhereAmI extends Activity {
  LocationManager locationManager;
  Geocoder geocoder;
  TextView textOut;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    textOut = (TextView) findViewById(R.id.textOut);

    locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
    geocoder = new Geocoder(this);

    // Initialize with the last known location
    Location lastLocation = locationManager
        .getLastKnownLocation(LocationManager.GPS_PROVIDER);
    if (lastLocation != null)
      onLocationChanged(lastLocation);

  }
}