countdown
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:A Java / Android client for Transport for London's Countdown live bus arrival time service
A Java/Android client and model for TfL's Countdown bus arrival time service.

Example usage:

import uk.co.eelpieconsulting.countdown.model.Arrival;
import uk.co.eelpieconsulting.countdown.model.Stop;
import uk.co.eelpieconsulting.countdown.model.StopBoard;

final CountdownApi api = new CountdownApi("http://countdown.api.tfl.gov.uk");
		
// Load a list of stops within a circle
System.out.println("Searching for stops within circle");
List stops = api.findStopsWithin(51.454, -0.351, 1000);
System.out.println("Found " + stops.size() + " stops");
Stop firstStop = stops.get(0);
System.out.println("This first one is: " + firstStop.getName() + " (" + firstStop.getId() + ") towards " + firstStop.getTowards() + " at " + firstStop.getLatitude() + ", " + firstStop.getLongitude());

// Load a list of expected arrivals for a stop
System.out.println("Loading arrivals for stop: " + firstStop.getId());
StopBoard stopBoard = api.getStopBoard(firstStop.getId());
Arrival firstArrival = stopBoard.getArrivals().get(0);
System.out.println("Next arrival is " + firstArrival.getRouteName() + " to " + firstArrival.getDestination() + ": " + firstArrival.getEstimatedWait());
System.out.println("Last updated: " + stopBoard.getLastUpdated());


Output:
Searching for stops within circle
Found 39 stops
This first one is: Tayben Avenue (55688) towards Fulwell or Isleworth at 51.454234, -0.342136
Loading arrivals for stop: 55688
Next arrival is 281 to Tolworth: 1339102817000
Last updated: 1339102411323



本源码包内暂不包含可直接显示的源代码文件,请下载源码包。