/[projects]/android/TrainInfo/src/dk/thoerup/traininfo/provider/XmlDepartureProvider.java
ViewVC logotype

Diff of /android/TrainInfo/src/dk/thoerup/traininfo/provider/XmlDepartureProvider.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 283 by torben, Thu Aug 27 08:34:50 2009 UTC revision 315 by torben, Fri Sep 11 08:34:57 2009 UTC
# Line 26  public class XmlDepartureProvider extend Line 26  public class XmlDepartureProvider extend
26          StringBuilder builder = new StringBuilder(512);          StringBuilder builder = new StringBuilder(512);
27                    
28          @Override          @Override
29          public void lookupDepartures(String station) {          public void lookupDepartures(int stationID) {
30                  departures.clear();                  departures.clear();
31                  try                  try
32                  {       String url = "http://t-hoerup.dk/tog/xml_display.php?stationname="+station;                  {      
33                            //String url = "http://t-hoerup.dk/tog/xml_display.php?stationcode="+stationCode;
34                            String url = "http://app.t-hoerup.dk/TrainInfoService/DepartureServlet?format=xml&station=" + stationID;
35                            Log.i("xmlurl",url);
36                          String doc =  DownloadUtil.getContentString(url, 45000, "ISO-8859-1");                          String doc =  DownloadUtil.getContentString(url, 45000, "ISO-8859-1");
37                                                    
38                          InputSource source = new InputSource( new StringReader(doc));                          InputSource source = new InputSource( new StringReader(doc));
# Line 40  public class XmlDepartureProvider extend Line 43  public class XmlDepartureProvider extend
43    
44                          xr.setContentHandler(this);                          xr.setContentHandler(this);
45                          xr.setErrorHandler(this);                          xr.setErrorHandler(this);
                         xr.setDTDHandler(this);  
46                          xr.parse(source);                          xr.parse(source);
47                  } catch (Exception e) {                  } catch (Exception e) {
48                          Log.e("XmlDepartureProvider", "looupFunction", e);                          Log.e("XmlDepartureProvider", "looupFunction", e);

Legend:
Removed from v.283  
changed lines
  Added in v.315

  ViewVC Help
Powered by ViewVC 1.1.20