NYU Bus Tracker is designed to combine the functionality of the NYU Mobile and Transloc apps (maps with real time bus locations) with the [massive schedules] (http://www.nyu.edu/life/travel-and-transportation/university-transportation.html) of the NYU bus system.
This app relies on the Transloc API for drawing the routes, getting real time bus locations, and getting the list of stops with locations. The bus times were manually parsed (not available from the API).
See the GitHub issues for a list of things that need to be done. All feature requests, bug reports, pull requests are welcome! Please let me know if you have any issues or questions. Thanks!
-
The data is modeled by Bus, Route, Stop, and Time classes. They are all managed by a singleton BusManager class. Routes have an in order list of Stops. Stops have a list of Routes that service that stop and a list of Times corresponding to that particular route. Data accesses from the activities go through BusManager. Tests for connection between stops generally go through BusManager, as well.
-
Every JSON file (segments, routes, stops, times) is cached when retrieved (except for bus locations). Background network calls are made to ensure data is up to date.
-
Adapters are required to display the list of stops and times. Stops can be selected as the start or end, or favorited by the user (so it appears at the top of the list). Times display which route they correspond to (sometimes, more than one route travels between stops A and B).
-
There is only one activity: [MainActivity] (../master/NYUBusTracker/src/main/java/com/nyubustracker/activities/MainActivity.java). In the future, we may add additional activities to access times in an alternate format (like by route + stop, instead of stop + stop).
- Install and open Android Studio.
- Open the SDK Manager (Tools > Android > SDK Manager) from Android Studio.
- Install API level 20, Android Support Repository, Android Support Library, Google Analytics App Tracking SDK, Google Play Services, and Google Repository, then close the SDK Manager.
- Fork this repository on GitHub by clicking the Fork button at the top right.
- Clone your fork inside Android Studio (VCS > Checkout from Version Control > Log in to GitHub > Select your fork > Click clone).
- Select use default gradle wrapper and click OK.
- If needed, open the project view by hovering over the icon at the bottom left of Android Studio.
- Set your API keys in the API keys file. You will need:
- A Google Developer project consuming the Maps API, following the directions here.
- A Mashape application consuming the Transloc OpenAPI 1.2 API.
- Optionally a Google Analytics application with production and debug properties.
- Optionally a Flurry Analytics company with production and debug applications.
- Connect an Android phone or an emulator. In my opinion, a physical phone is easier to use. But, if you don't have one, you can try the built in Android emulator or a (much faster) Genymotion emulator. As a warning, you may have to do some extra work to get maps working in an emulator.
- Run the app (green arrow at the top of Android Studio)!
Here is the release process, for when you're ready to push a new version to the Play Store.
- Make sure
MainActivity.LOCAL_LOGV = false
. Run the app and make sure there is no logging. - Make sure the
DownloaderHelper.AMAZON_URL
is correct. - Make sure your API keys are correct.
- Upgrade any dependencies.
- Bump the release version in
build.gradle
. git commit -am "Preparing release X.Y"
- Tag a release on GitHub.
./gradlew assembleRelease
- Run the app as a last minute check, to make sure everything is in working order.
- Upload.
Please see the LICENSE file for license information.