17.07.2015 Views

OCTranspoLive: A live OCTranspo GPS bus location application for ...

OCTranspoLive: A live OCTranspo GPS bus location application for ...

OCTranspoLive: A live OCTranspo GPS bus location application for ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

arrival times <strong>for</strong>. Upon pressing the button labeled Get Routes, an HTTP requestto the <strong>OCTranspo</strong> Live Next Bus Arrival Data Feed API is made. In the packagecom.rakrezzik.schedule_tasks, there is a class called DownloadRouteInfo. This is anAsyncTask used to do the background network operation as Android does not allowthem on the main thread. The user will see a ProgressDialog like in the rst screenshotof Figure 4 while waiting <strong>for</strong> the HTTP request. Once the request is fullled theuser is greeted with a list of routes they may choose from. Upon selecting a routean Intent is used to start a StopScheduleActivity <strong>for</strong> that stop and route. It will looklike the second screenshot in Figure 4.Figure 4: Obtain Routes <strong>for</strong> StopThe times are updated every 30 seconds through a background thread runningand instance of a Runnable class called TimesUpdater, a private class within theStopScheduleActivity class. In the action bar below the dynamic timetable are twooptions the user can choose from. The rst, represented by an ImageButton with astar, is to add this stop and route to the user's favourites <strong>for</strong> quick access the next18

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!