Skip to content

the-blue-alliance/the-blue-alliance-android

Repository files navigation

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 be able to open your 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 Android Studio and a JDK.
  3. See Tips and Tricks for developing with Android Studio.
  4. Use the Android SDK Manager to download the correct versions of the Android SDK Platform, Android SDK Build-Tools, Android SDK Platform-Tools, Android SDK Tools, Android Support Library, Android Support Repository, and Google Repository. See build.gradle and android/build.gradle for the currently needed versions. While you're downloading, the Documentation for Android SDK and the SDK Platform Sources are also useful.
  5. If you have an Android device to test on, make sure to enable USB Debugging in its Settings menu.
  6. Configure an Android Virtual Device (AVD) to debug with. 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 might have to run that installer, depending on your development OS.
  7. Set up a Firebase project for login authentication and remote configuration:
    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. If not, you could name the new one something like "YOURNAME-tba-dev".
    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. Use the TBA Account Overview page to create an APIv3 "Read API Key" auth key.
    9. In the Firebase console, create a Remote Config,
    10. then add this parameter: apiv3_auth_key = <your TBA v3 auth key>,
    11. and add this parameter: appspot_projectId = <your Firebase project name>,
    12. then click PUBLISH CHANGES.
    13. You should now be able to build and run the app. If you have FirebaseCrash in use, it'll throw an exception in app init if the google-services.json file is invalid.
  8. 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.