Git Product home page Git Product logo

the-blue-alliance-android's Introduction

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.

the-blue-alliance-android's People

Contributors

1fish2 avatar adam8234 avatar bherbst avatar brycematsuda avatar dracco1993 avatar fangeugene avatar fishdog5000 avatar gregmarra avatar mechinn avatar nwalters512 avatar phil-lopreiato avatar randomtestfive avatar samrmur avatar spencerng avatar sunnyraj avatar supercilex avatar techguydave avatar teityan avatar waffle-iron avatar zachorr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

the-blue-alliance-android's Issues

Settings up button on action bar

In the settings activity there is no up button on the action bar. This is something that I can do. I was showing the app to people. One of the things that they complained about.

astuetz's Page Slider Library Gradle Refresh Error

Gradle is giving me a error when refreshing the project.

"No cached version of com.astuetz:pagerslidingtabstrip:1.0.1 available for offline mode."

There seems to be an issue with the Pager Sliding Tab Library that you are using to display team numbers and week events.

Flickr implementation & logo usage

I noticed Flickr was missing from the social media bar in event / team info, and was planning on implementing it when I found this:

Don't use the Flickr trademarks, unless you have explicit written permission. This includes calling an app built for a specific platform "Flickr". Please note that using the Flickr API does not include Flickr trademarks, such as the Flickr logo, dots, or the string "Flickr". At this time, if you want to use these trademarks, you can apply via our trademark permission process.

https://secure.flickr.com/services/developer/business/

I also saw they have badges to put on your website, so I'm a bit lost as if we can use the logo or not in the app, since it will link to a Flickr search like the TBA site. The other social media sites make it pretty clear that it's okay to use their logo for social media purposes so long as you're not messing it up too much.

https://secure.flickr.com/about/goodies/

Did the TBA site have to do anything special?

Improve README

  • Link to developer mailing list
  • Link to design documents folder

Project doesn't have source

When @plnyyanks removed the iml files and such. When you open the project all you have is the gradle files.

Caching Media Images

Now that we load some images from the internet (team media, video thumbnail), we should really cache them locally.

Maybe we can extend our API caching model with another SQL table that maps a URL to a local filepath (and fetches if it needs to).

We're going to want to store in internal storage, probably in the directory returned by this method. And we should also think about ways to prune the things we store to prevent disc usage from getting out of hand.

Wrong key being passed to DataManager in Awards

After pulling the latest master, I was doing my usual stress tests when I hit an NPE crash whenever I tried viewing team info from the Awards tab, which had never happened beforehand. Adding null checks didn't seem to work, but then I noticed something odd in the title/header bar after a couple of crashes.

screenshot_2014-05-15-01-41-37

I checked logcat and found in each crash DataManager trying to load the URL http://thebluealliance.com/api/v2/team/[award key] (e.g: http://thebluealliance.com/api/v2/team/2014casb_Regional Chairman's Award)

Full logcat: http://pastebin.com/QfXU8yDE

Replace SettingsActivity with a PreferenceFragment

As per the Settings documentation:

Note: If you're developing your application for Android 3.0 and higher, you should instead use PreferenceFragment. Go to the next section about Using Preference Fragments.

Nearly all of the methods in PreferenceActivity are deprecated, and using a PreferenceFragment is the clear recommendation.

This would also eliminate the need for Build.VERSION_CODES.HONEYCOMB checks and related annotations.

Only show warning messages for actively changing data

For example. If you've downloaded an event from last year, and you're currently offline, the app doesn't need to show the warning message that the content could be outdated (since the event is over, its data won't change any further)

Remove Default Text in layouts

For views that have their content set dynamically, we should take out the default text. When loading (it's most obvious on the Event Details), you catch a glimpse of that text (e.g. "Event Name") before its replaced with the real content.

NPE in AllianceListElement

Steps to reproduce:

  1. Go to any event page with match results & alliances
  2. Quickly open the Quarterfinals and Alliances section, one after the other (or spam opening/closing both of them)

Pastie: http://pastie.org/private/xzsjretjxpwoqvsebghsg

YouTube: https://www.youtube.com/watch?v=mnaZkWE-g0w

Attempted fixes:
Null checks to convertView.findViewById(R.id.alliance_name) and c.getString(R.string.alliance_title) at the bugged line if (convertView != null) didn't work. It either still NPE'd or, in one case, went mental and loaded a mixture of matches and alliances at random.

Events from different years are not displayed/loaded properly

STEPS TO REPRODUCE

  1. Launch app, go to Events view
  2. Change year from 2014 to 2012 or 2013
    At this point, you'll see that the events list is still showing what it did in 2014. This is the first issue.
  3. Rotate the device to force a recreation of all activities and fragments
    At this point the list will be blank, and the LogCat output will reveal a NPE.

This is obviously at least an issue with communication between the action bar spinner and the child fragments, but there is also a probably issue with the loading and storing of event data.

Blank 'Week 0' in 2012

screenshot_2014-05-23-19-05-05

I originally thought it came from stress tests, but I cleared the app data and it still came up when I loaded it normally.

Team name/location formatting in Teams List

The &'s and "'s among others, don't seem to be formatted correctly when viewed from the giant list of teams.

img_0487

(Android tablet isn't saving pics correctly for some reason. Had to take it with my phone.)

Also noticed teams with giant names/lots of sponsors are pushing the name down so much where the team name is at where the location should be and the location is gone.

It's formatted fine in the individual event 'Teams' tab, so it can probably can be fixed by implementing the giant list like how the individual events do it.

Navigation Drawer Styling

In the name of keeping threads on topic. From @nwalters512, #10 (comment)

"Looking good! Kind of a digression, but while we're talking design, what do
we think about having a lighter navigation drawer like in the various Play
apps? I like the emphasis on our branding (blue), but the nav drawer feels
overly dark to me."

App-wide searching for teams and events

Search needs to be accessible from almost anywhere in the app.

Teams need to match by team number and partial team name. "254 The Cheesy Poofs" needs to match with "2(54)", "t(he)", "c(heesy)", and "p(oofs)", but not necessarily "eesy".

Events need to match by event code and partial event name. "2014 Silicon Valley Regional [CASJ]" needs to match with "2(014)", "s(ilicon)", "v(alley)", "r(egional)", and "c(asj)", but not necessarily "ilicon".

Be wary of unicode characters; "ÜberBots" needs to match with "Ü(berbots)" as well as "u(berbots)".

Handle no internet connection better

There are several issues at hand here. The most important is with the caching of teams and events in the SQLite database. If there is no internet connection, loading either one fails very silently and marks the list as loaded (even though it isn't) so subsequent queries don't try to reload the list. The other is indicating to the user that they're using cached data if they do happen to be offline. This might take the form of a panel that slides in from the bottom and indicates that the data they are seeing may be out of date.

Event List Text Overflow

See Hatboro-Horsham - location and dates overlay on top of each other. We need to put a max-width for the location.
screenshot_2014-05-06-22-08-44

Events by Week Performance Issues in v0.2.2

As mentioned in #82:

device-2014-05-29-213302
device-2014-05-29-160447

  • 2007 preseason events sometimes takes over the offseason events when stress testing.

device-2014-05-30-001944
device-2014-05-30-001919

  • I have also produced a rare case where 2014 offseason events showed up in 2004 offseason. Didn't take a picture as I wasn't thinking and caused an NPE by clicking an event :\ Haven't reproduced it since, so it's probably one of those that you really have to push the fragment to its limit in order to get.
  • Noticeable lag/stutter in the navbar when switching from the Teams activity to the Events activity if the Teams activity is downloading information for the first time. I have gotten it to freeze by changing the team range tabs rapidly and then switching to Events, but like the above one, haven't gotten it since for likely the same reasons.

Show "current" tab in events view

During competition season, the default tab, and the first tab in the list, should be "Current". This tab would show what events are occurring in that week. If no events are found, the tab would not appear.

Alliances in Team @ Event Suggestions

I noticed when viewing various Team @ Event pages is that the alliances for that event are always shown, even if that team wasn't picked by an alliance for elims which, to me, feels a bit pointless.

device-2014-06-05-140518

Would it be possible to hide the alliances tab if say, there isn't any data on that team for elims? Or display a text like "This team did not advance to eliminations"?

For a team that did advance to elims, displaying all 8 alliances with the current format might make it hard for users to find their team. I was thinking either bolding the team, or just displaying the alliance that team is on.

Error:(3, 0) CreateProcess error=2, The system cannot find the file specified

C:\Users\Bryce Matsuda\Documents\GitHub\the-blue-alliance-android\android\build.gradle
Error:(3, 0) CreateProcess error=2, The system cannot find the file specified

In idea.log:
2014-05-08 08:19:42,182 [ 44043] WARN - .project.GradleProjectImporter -
2014-05-08 08:19:42,182 [ 44043] INFO - .project.GradleProjectImporter - CreateProcess error=2, The system cannot find the file specified

Consult IDE log for more details (Help | Show Log)

Seem to get this every time I load up Android Studio and try to sync the project with the gradle files after pushing the latest commits., yet the build.gradle is still in there.

untitled

Weeks overlap briefly when changing years in fix_event_years

Something I noticed after downloading the latest commits (post merge of my PR)

vlcsnap-2014-05-25-17h27m22s222
vlcsnap-2014-05-25-17h29m21s201

It's only for a very brief moment after switching years. It happened too quickly to use the screenshot function, so I ended up recording a short clip, pausing it on the playback and taking a picture.

Code Style

...Continued from #69, since I merged that PR.

I'm not really a fan of the 'm' prefix personally, I think it gets in the way of readability and it's usually pretty obvious when things are member variables and when they aren't. But we should definitely pick one of the other, and I don't think it really matters which.

Also, I think we should come up with a style guide and make a page in the wiki for it to document and encompass all of our coding conventions (so new users can make sure everything is properly formatted).

Add "glanceable" info

A comment was recently posted on the Facebook page:

Make the home page have all the necessary 'glanceable' info about your team. So you can see your ranking/match schedule quickly while at competition, no one has got that interface right yet.

I think this is actually a really important feature to consider. No other FIRST app has this; Spyder has the ability to "favorite" teams and events, but there's no general overview of them. Currently you have to drill down through about 3 levels of spyder to find the schedule, and finding your team's rank means you have to scroll through the entire list to find your team. If we could get this working well, this would be a game-changer.

I don't know if this is necessarily MVP-worthy, but I think we will eventually have to add this feature. It's too good for us not to.

Instructions to get going

Add instructions to get going to the readme

Should walk someone through:

  • how to set up an Android dev environment
  • what to do to get going with this app

Past Year Team Data

We need the ability to view historical team data (events attended and media) for past years. The UI should function like the Event activity - on those two tabs, there should be a spinner in the action bar to go back for the years that data exists for.

Changing orientation switches screen back to "Week 1"

Happens everywhere aside from the Settings and when viewing individual event info.

Viewing 2012/2013 events and then rotating the screen gives a blank events page on different tabs. Logcat gives the following when the blank page appears: http://pastebin.com/ngw76qAf

Going back to 2014 events and switching orientation seems to fix this and brings back the events.

Suspect it has something to do with the instance states if I recall correctly from CS class, though I haven't seen android code since the end of last year.

Change Nav Drawer to use static LinearLayout

This would give us more flexibility and control with layout and visual appearance, for instance removing the dividers between certain items and controlling the background color of certain items (to mimic the style that Google apps use).

Events fail to open at all after viewing some in Events tab.

The easiest way to reproduce this is to open and close an event in one week, switch to another week, open and close another event, then switch once more to a different week, and find that tapping other events does nothing. Sometimes an event will open as seen in the YT video, but switching again to another week brings back its odd behavior.

Can be fixed by rotating screen, loading an event from a team info page, or reloading the app.

Video: https://www.youtube.com/watch?v=D3bZMgyvwTI

Indicate When No Event Data Exists

When an offseason event doesn't have some data set (like ranking), its fragment will show up entirely blank. We should alert the user that the date being requested doesn't exist for the event (either via the messaging framework or just by inserting a TextView in the layout saying so).

Show loading indicators in fragments

This is a formal issue acknowledging the need to have loading indicators in fragments that need to load data from the API. We'll probably want indefinite ProgressBars.

Static XML Layouts

Rather than make 15 issues for each layout, I'll list the things that need to be mocked up natively here:

  • Base Activity
    • Event List (per year, tabs for week)
    • Team List
    • Insights (maybe)
  • Event View Activity
    • Event Info
    • Results
    • Rankings
    • Awards
    • Teams Attending
    • Stats (maybe)
  • Team View Activity
    • Team Info
    • Event List (Should just be an existing fragment with different query parameters)
    • Team Media
  • Match View Activity (with results and videos)
  • Team @ Event (results of a single team's matches)

Hackathon Ideas

Our hackathon is going to be Saturday June 28! Here's a list of cool features/ideas that I've been holding on to. Feel free to implement any of these ideas yourselves, or use them as a jump point for your own. Just tag them with hackathon and get coding!

  • Local API (another app send this one an intent with a request for a TBA API URL, and we either return from our cache or fetch it if we have to). This can take some strain off the API servers with multiple apps on one device downloading the same data.
  • Google/TBA Account Integration. Start by selecting an account in this sequence. Display the current account in the action bar like Google Keep does.
  • Take photos/videos on device, submit to TBA for team/match media.
  • Follow teams/events - get push notifications when things happen or are about to happen (team X played/won, is playing next match, event X just started elims). Maybe setup some IFFT criteria (like new high score). Don't just copy Megaphone.
  • Mobile Gameday. See all current events, open streams in appropriate app (or try and load in webview). Chromecast support for streaming webcasts to your TV?
  • Better data caching - limit sizes, age of data. Implement 304 UNCHANGED on both ends. Once data has been queried on the device, set a timeout before it can be refreshed again - so if you open a screen, close it, and open it again rapidly, it doesn't keep requesting the same data.
  • Add district types (NEFIRST, FIM, MAR, PNW, etc) to models - return via API and display event lists separated by district location
  • Make team activity work for previous years (events/media) - action bar spinner like Events
  • Add in Insights (and add to API)
  • Select some data (like favorite events' scores) to update in background - no user initiated refresh required. This can tie into push notifications
  • Use location services to suggest events/teams near you. Or heavily feature (with more instant data, default screen) event the user is currently at
  • Smartwatch integration with push notifications. Pebble? Android Wear?
  • TBA media admin features (approve/deny media suggestions) and corresponding API.
  • Get one of the libraries for Android tests without device (like Roboeletric or Robotium) working and stable
  • FRC Notebook integration (provide intent to make note on X)

UI Test Python Script & travis-ci/gradle integration

After a few days of tearing my hair out trying to get a UI testing tool to work without Gradle or the terminal complaining about something, I managed to find a easy to understand python framework called AndroidViewClient which combines all of monkeyrunner's API plus some of uiautomatorviewer's features.

py-monkey

I've managed to get a few tests working from my device, and it works great. My only concern/question is if it can be implemented into travis-ci/gradle, or if it'll probably have to be done independently. To be honest I never heard of either of them up until joining the project and even after reading the documentation I don't quite understand the real in's and out's of it (aside from running unit tests).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.