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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.1.2 StopsNearActivityOne of the options the user can select from the main menu is to look <strong>for</strong> stops nearthem. This will create and Intent object and then start the StopsNearActivity usingstartActivity. When this Activity is created the <strong>location</strong> services are used to nd theuser's <strong>location</strong>. If available the <strong>GPS</strong> will be used <strong>for</strong> a ne-grained <strong>location</strong> and ifnot Google's <strong>location</strong> service will be used, provided the WiFi on the device is turnedon. When the user's coordinates are found a request is made to the <strong><strong>OCTranspo</strong>Live</strong>API. This is done using an HTTP GET request like the one below.Listing 2: Near Stops Requesthttp : / / l o c a l h o s t :8080/ octranspo_api / r e s t / stops / near ? l a t=45.4104& lon =−75.6935Figure 3: Finding <strong>bus</strong> stops near youIn Figure 3 the rst screenshot shows what the user will see while waiting <strong>for</strong>16

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

Saved successfully!

Ooh no, something went wrong!