8 |
|
|
9 |
import android.location.Location; |
import android.location.Location; |
10 |
import android.util.Log; |
import android.util.Log; |
11 |
import dk.thoerup.traininfo.StationBean; |
import dk.thoerup.android.traininfo.common.StationBean; |
12 |
import dk.thoerup.traininfo.util.DownloadUtil; |
import dk.thoerup.traininfo.util.DownloadUtil; |
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 StationBean lookupStationsByName(String name) { |
19 |
|
return null; // Not supported |
20 |
} |
} |
21 |
|
|
22 |
@Override |
@Override |
23 |
public boolean lookupStationsByIds(String ids) { |
public StationBean lookupStationsByIds(String ids) { |
24 |
return false; |
return null; |
25 |
} |
} |
26 |
|
|
27 |
@Override |
@Override |
28 |
public boolean lookupStations(Location location) { |
public StationBean lookupStations(Location location) { |
29 |
boolean success = false; |
|
30 |
|
StationBean stations = new StationBean(); |
31 |
|
/* |
32 |
//ToDo: to be nice put the api key into the request |
//ToDo: to be nice put the api key into the request |
33 |
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"; |
34 |
//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"; |
66 |
Log.e("Location", title + " " + lat +"," + lng); |
Log.e("Location", title + " " + lat +"," + lng); |
67 |
} |
} |
68 |
|
|
|
success = true; |
|
69 |
} catch (Exception e) { |
} catch (Exception e) { |
70 |
Log.e("Location","Location",e); |
Log.e("Location","Location",e); |
71 |
} |
return null; |
72 |
return success; |
}*/ |
|
} |
|
|
|
|
|
@Override |
|
|
public List<StationBean> getStations() { |
|
73 |
return stations; |
return stations; |
74 |
} |
} |
|
|
|
|
|
|
75 |
} |
} |