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"; |
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 |
} |
} |