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

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

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

revision 1005 by torben, Tue Feb 2 08:41:18 2010 UTC revision 1006 by torben, Mon Aug 2 23:18:53 2010 UTC
# Line 13  import dk.thoerup.traininfo.util.Downloa Line 13  import dk.thoerup.traininfo.util.Downloa
13  @Deprecated  @Deprecated
14  public class GoogleStationProvider implements StationProvider {  public class GoogleStationProvider implements StationProvider {
15    
         List<StationBean> stations = new ArrayList<StationBean>();  
16                    
17          public boolean lookupStationsByName(String name) {          
18                  return false; // Not supported          public List<StationBean> lookupStationsByName(String name) {
19                    return null; // Not supported
20          }          }
21                    
22          @Override          @Override
23          public boolean lookupStationsByIds(String ids) {          public List<StationBean> lookupStationsByIds(String ids) {
24                  return false;                  return null;
25          }          }
26                    
27          @Override          @Override
28          public boolean lookupStations(Location location) {          public List<StationBean> lookupStations(Location location) {
29                  boolean success = false;                  List<StationBean> stations = new ArrayList<StationBean>();
30                    
31                  //ToDo: to be nice put the api key into the request                  //ToDo: to be nice put the api key into the request
32                  String urlSource = "http://www.google.com/uds/GlocalSearch?callback=google.search.LocalSearch.RawCompletion&context=1&q=Train%20station&near=" + location.getLatitude() + "%2C" + location.getLongitude() + "&v=1.0";                  String urlSource = "http://www.google.com/uds/GlocalSearch?callback=google.search.LocalSearch.RawCompletion&context=1&q=Train%20station&near=" + location.getLatitude() + "%2C" + location.getLongitude() + "&v=1.0";
33                  //String urlSource = "http://www.google.com/uds/GlocalSearch?callback=google.search.LocalSearch.RawCompletion&context=1&q=Train%20station&near=56.2%2C9.0&v=1.0";                  //String urlSource = "http://www.google.com/uds/GlocalSearch?callback=google.search.LocalSearch.RawCompletion&context=1&q=Train%20station&near=56.2%2C9.0&v=1.0";
# Line 64  public class GoogleStationProvider imple Line 65  public class GoogleStationProvider imple
65                                  Log.e("Location", title + " " + lat +"," + lng);                                  Log.e("Location", title + " " + lat +"," + lng);
66                          }                          }
67    
                         success = true;  
68                  } catch (Exception e) {                  } catch (Exception e) {
69                          Log.e("Location","Location",e);                          Log.e("Location","Location",e);
70                            return null;
71                  }                  }
                 return success;  
         }  
   
         @Override  
         public List<StationBean> getStations() {  
72                  return stations;                  return stations;
73          }          }
   
   
74  }  }

Legend:
Removed from v.1005  
changed lines
  Added in v.1006

  ViewVC Help
Powered by ViewVC 1.1.20