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

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

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

revision 318 by torben, Fri Sep 11 11:51:57 2009 UTC revision 319 by torben, Fri Sep 11 12:24:53 2009 UTC
# Line 30  public class XmlStationProvider implemen Line 30  public class XmlStationProvider implemen
30          }          }
31    
32          @Override          @Override
33          public void lookupStations(Location location) {          public boolean lookupStations(Location location) {
34                                    boolean success = false;
35                  String url = "http://app.t-hoerup.dk/TrainInfoService/LocateStations?latitude=" + location.getLatitude() + "&longitude=" + location.getLongitude();                  String url = "http://app.t-hoerup.dk/TrainInfoService/LocateStations?latitude=" + location.getLatitude() + "&longitude=" + location.getLongitude();
36                  Log.i("url", url);                  Log.i("url", url);
37                  try {                  try {
# Line 83  public class XmlStationProvider implemen Line 83  public class XmlStationProvider implemen
83    
84                                  }                                  }
85                                  stations.add(station);                                                            stations.add(station);                          
86                          }                                        }
87                            success = true;
88                                                    
89                                                    
90                  } catch (Exception e) {                  } catch (Exception e) {
91                          Log.e("XmlStationProvider", "lookupStations: ", e);                          Log.e("XmlStationProvider", "lookupStations: ", e);
92                  }                  }
93                    return success;
94          }          }
95    
96          public Document parseXML(String str) throws SAXException, IOException, ParserConfigurationException          private Document parseXML(String str) throws SAXException, IOException, ParserConfigurationException
97          {          {
98                  DocumentBuilder builder =  DocumentBuilderFactory.newInstance().newDocumentBuilder();                  DocumentBuilder builder =  DocumentBuilderFactory.newInstance().newDocumentBuilder();
99                  return  builder.parse( new ByteArrayInputStream(str.getBytes()) );                                return  builder.parse( new ByteArrayInputStream(str.getBytes()) );              

Legend:
Removed from v.318  
changed lines
  Added in v.319

  ViewVC Help
Powered by ViewVC 1.1.20