16 |
List<StationBean> stations = new ArrayList<StationBean>(); |
List<StationBean> stations = new ArrayList<StationBean>(); |
17 |
|
|
18 |
@Override |
@Override |
19 |
public void lookupStations(Location location) { |
public boolean lookupStations(Location location) { |
20 |
|
boolean success = false; |
21 |
//ToDo: to be nice put the api key into the request |
//ToDo: to be nice put the api key into the request |
22 |
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"; |
23 |
//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"; |
55 |
Log.e("Location", title + " " + lat +"," + lng); |
Log.e("Location", title + " " + lat +"," + lng); |
56 |
} |
} |
57 |
|
|
58 |
|
success = true; |
59 |
} catch (Exception e) { |
} catch (Exception e) { |
60 |
Log.e("Location","Location",e); |
Log.e("Location","Location",e); |
61 |
} |
} |
62 |
|
return success; |
63 |
} |
} |
64 |
|
|
65 |
@Override |
@Override |