--- android/TrainInfo/src/dk/thoerup/traininfo/StationLocator.java 2009/09/10 19:09:09 310 +++ android/TrainInfo/src/dk/thoerup/traininfo/LocationLookup.java 2009/09/11 12:24:53 319 @@ -10,29 +10,22 @@ import android.os.Bundle; import android.os.Handler; import android.util.Log; -import dk.thoerup.traininfo.provider.ProviderFactory; -import dk.thoerup.traininfo.provider.StationProvider; -public class StationLocator implements LocationListener{ + +public class LocationLookup implements LocationListener{ LocationManager locManager; Context cntx; Handler hndl; - StationProvider provider; Location savedLocation = null; boolean hasGps; - public StationLocator(Context c, Handler h) { + public LocationLookup(Context c, Handler h) { cntx = c; hndl = h; - provider = ProviderFactory.getStationProvider(); - } - - public List getStations() { - return provider.getStations(); } public void abortLocationListener() { @@ -42,6 +35,11 @@ public boolean hasLocation() { return savedLocation != null; } + + public Location getLocation() + { + return savedLocation; + } public void locateStations() { hasGps = false; @@ -80,11 +78,8 @@ locManager.removeUpdates(this); hndl.sendEmptyMessage(TrainInfoList.GOTLOCATION); } - - public void findNearestStations() { - findNearestStations(savedLocation); - } - + /* + public void findNearestStations(Location location) { provider.lookupStations(location); @@ -92,7 +87,7 @@ hndl.sendEmptyMessage(TrainInfoList.GOTSTATIONLIST); else hndl.sendEmptyMessage(TrainInfoList.LOOKUPSTATIONFAILED); - } + }*/ @Override