The Blue Alliance - Android App
![Stories in On Hold](https://badge.waffle.io/the-blue-alliance/the-blue-alliance-android.png?label=on-hold&title=On%20Hold)
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!
- Set up your development environment if you haven't used Android Studio before (see below).
- Fork this repository, import the project to your IDE, and create a branch for your changes.
- Make, commit, and push your changes to your branch.
- 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
- 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.
- If you haven't already, make sure you have the Android development environment set up. You will need Android Studio and a JDK.
- See Tips and Tricks for developing with Android Studio.
- 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.
- If you have an Android device to test on, make sure to enable USB Debugging in its Settings menu.
- 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.
- Set up a Firebase project for login authentication and remote configuration:
- Open the Firebase console.
- 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".
- Click "Add Firebase to your Android app".
- Enter the package name
com.thebluealliance.androidclient.development
into the form.
- Follow these instructions to determine your debug SHA1. Enter that into the form.
- Continue. It should download a
google-services.json
file.
- 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.
- Use the TBA Account Overview page to create an APIv3 "Read API Key" auth key.
- In the Firebase console, create a Remote Config,
- then add this parameter:
apiv3_auth_key
= <your TBA v3 auth key>,
- and add this parameter:
appspot_projectId
= <your Firebase project name>,
- then click
PUBLISH CHANGES
.
- 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.
- 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.