/the-blue-alliance-android

An Android app for accessing information about the FIRST Robotics Competition.

Primary LanguageJavaMIT LicenseMIT

The Blue Alliance - Android App

Build Status Coverage Status Stories in Ready Stories in Needs Review Stories in On Hold

An Android app for accessing information about the FIRST Robotics Competition. This is a native mobile version of The Blue Alliance.

The app has been released to the Play Store! We also have a beta tester community that you can join to try some of the latest and greatest features without having to build the app yourself. Just remember, there may still be issues. If you find any, please report them on the issue tracker so we can fix them.

Contributing

Want to add features, fix bugs, or just poke around the code? No problem!

Project Management

Learning

  • Read through the Project Wiki to get comfortable with some of the technologies we use.
  • Learn some basics of Dependency Injection, specifically Dagger2, to understand one of the core components of our app.

Make Commits!

  1. Set up your development environment if you haven't used Android Studio before (see below).
  2. Fork this repository, import the project to your IDE, and create a branch for your changes.
  3. Make, commit, and push your changes to your branch.
  4. Submit a pull request here and we'll review it and get it added in!

For more detailed instructions, see GitHub's Guide to Contributing.

Code Style

We use the base Android Code Style. When you set up Android Studio, copy AndroidStyle.xml into your config directory,

  • on Linux: ~/.AndroidStudioXX/config/codestyles/
  • on OSX: ~/Library/Preferences/AndroidStudioXX/codestyles/

Then start Android Studio, open Settings -> Editor -> Code Style, and in the dropdown, select AndroidStyle.

Environment Setup

  1. Ensure that you have git installed and that it is added to your system's PATH variable. You should open you system's shell, navigate to a git repository (like this one), run git status, and get status info.
  2. If you haven't already, make sure you have the Android development environment set up. You will need to have Android Studio and a JDK installed.
  3. See Tips and Tricks for developing with Android Studio.
  4. Use the Android SDK Manager to download the correct versions of the Android libraries. You will need to download the Android SDK Tools, Android SDK Platform-Tools, and the SDK Platform for Android. See build.gradle and android/build.gradle for the currently needed versions.
  5. If you have an Android device to test on, make sure to enable USB Debugging in its Settings menu. Otherwise, configure an Android Virtual Device (AVD) to debug with. To use a virtual device, you'll have to download an Android System image via the SDK manager. Android x86-based System images run much faster than ARM-based System images but they require Virtual Machine Acceleration. Note that the SDK manager will install the Intel HAXM installer on your local disk; you still have to run that installer unless the Android Studio installer does it for you.
  6. Set up a Firebase project to enable login authentication:
    1. Open the Firebase console.
    2. Create a Firebase project. (If you have a TBA dev web site AppEngine project, you can use that project to link them together. That ought to prove useful, but it's not required.)
    3. Click "Add Firebase to your Android app".
    4. Enter the package name com.thebluealliance.androidclient.development into the form.
    5. Follow these instructions to determine your debug SHA1. Enter that into the form.
    6. Continue. It should download a google-services.json file.
    7. Move the downloaded google-services.json file into android/src/debug/. Note: Don't put it in the directory shown in the "Add Firebase to your Android app" instructions.
    8. You should be able to build and run the app. If you have FirebaseCrash in use, it'll throw an exception in app init if the file is invalid.
  7. To run the unit tests, do ./gradlew test

myTBA Debug Setup

Debug builds of the TBA app cannot receive (Google Cloud Messaging) push notifications from production TBA servers. To test the myTBA features of the app, e.g. to test push notifications end-to-end, you must set up a debug TBA server then configure the server and temporarily modify the app code. For help setting up your own development server to test myTBA with, see this wiki page.

But you don't need to do all that to test the app's local handling of push notifications. The easy way is to run scripts/test_notification.py. It uses adb to send notification Intents locally.