Skip to content

tbpalsulich/NYU-BusTracker-Android

Repository files navigation

NYU Bus Tracker

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!

Design

  • 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

  1. Install and open Android Studio.
  2. Open the SDK Manager (Tools > Android > SDK Manager) from Android Studio.
  3. 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.
  4. Fork this repository on GitHub by clicking the Fork button at the top right.
  5. Clone your fork inside Android Studio (VCS > Checkout from Version Control > Log in to GitHub > Select your fork > Click clone).
  6. Select use default gradle wrapper and click OK.
  7. If needed, open the project view by hovering over the icon at the bottom left of Android Studio.
  8. Set your API keys in the API keys file. You will need:
  1. 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.
  2. Run the app (green arrow at the top of Android Studio)!

Release

Here is the release process, for when you're ready to push a new version to the Play Store.

  1. Make sure MainActivity.LOCAL_LOGV = false. Run the app and make sure there is no logging.
  2. Make sure the DownloaderHelper.AMAZON_URL is correct.
  3. Make sure your API keys are correct.
  4. Upgrade any dependencies.
  5. Bump the release version in build.gradle.
  6. git commit -am "Preparing release X.Y"
  7. Tag a release on GitHub.
  8. ./gradlew assembleRelease
  9. Run the app as a last minute check, to make sure everything is in working order.
  10. Upload.

Please see the LICENSE file for license information.