--- android/TrainInfo/src/dk/thoerup/traininfo/provider/XmlStationProvider.java 2009/10/03 10:55:43 391 +++ android/TrainInfo/src/dk/thoerup/traininfo/provider/XmlStationProvider.java 2010/02/02 08:39:15 576 @@ -28,13 +28,13 @@ @Override public boolean lookupStations(Location location) { - String url = XmlUtil.SERVICE_BASE + "/LocateStations?latitude=" + location.getLatitude() + "&longitude=" + location.getLongitude(); + String url = XmlUtil.SERVICE_BASE + "/LocateStations?latitude=" + (float)location.getLatitude() + "&longitude=" + (float)location.getLongitude(); Log.i("url", url); return lookupStationsWorker(url); } @Override - public boolean lookupStations(String name) { + public boolean lookupStationsByName(String name) { // String url = XmlUtil.SERVICE_BASE + "/LocateStations?name=" + Uri.encode(name); String url = ""; @@ -50,6 +50,16 @@ } + @Override + public boolean lookupStationsByIds(String ids) { + String url = ""; + url = XmlUtil.SERVICE_BASE + "/LocateStations?list=" + ids; + + Log.i("url", url); + return lookupStationsWorker(url); + } + + public boolean lookupStationsWorker(String url) { boolean success = false; @@ -94,11 +104,20 @@ if (nodeName.equals("longitude")) station.setLongitude( Double.parseDouble(content) ); - if (nodeName.equals("stationcode")) - station.setCode(content); - if (nodeName.equals("calcdist")) station.setDistance( (int) Double.parseDouble(content) ); + + if (nodeName.equals("address")) + station.setAddress( content ); + + if (nodeName.equals("regional")) + station.setRegional( Boolean.parseBoolean(content) ); + + if (nodeName.equals("strain")) + station.setSTrain( Boolean.parseBoolean(content) ); + + if (nodeName.equals("metro")) + station.setMetro( Boolean.parseBoolean(content) ); } stations.add(station);