Upgrading the Android version and related components

Merged Craig Earley requested to merge upgrade-android-version into master

This batch of changes upgrades Field Day so that it targets and compiles against SDK version 27. It also fixes some Android Lint warnings and modernizes a few other system settings. It's a significant change to the code, so it must be tested before being merged into the main branch.


We've been running SDK version 22, which is far behind the most recent SDK version (28). Before the last Iceland trip we attempted an update, but we quickly reverted to 22. This was because a series of problems we vaguely thought related to permissions kept crashing the app, and we were too close to the trip to study the niceties of an upgrade at the time. But I still wanted to fix it.

To do this development, I used Android Studio and ran the app on my local Android device, which runs Android 6.0.1. I was prompted to upgrade Studio to version 3.4 in the middle of the process and did so. I used the Maria platform for Bluetooth testing.


We were correct that our upgrade problem last time was related to permissions: specifically, from the release of Android 6 (SDK version 23), runtime permissions became important, and we never prompted the user to provide them.

I implemented requests for all the permissions we use that Google requires user permission for (it labels them "dangerous"):

  • location (prompt appears immediately upon launching the app)
  • camera (prompt appears when you tap "take picture" on any sampling screen)
  • reading and writing local files (prompt appears when you tap "take picture" or begin database actions)

This jump, from v22 to v23, seems to have been the biggest change. The subsequent steps, updating from SDK version 23 to 27, seemed straightforward, so I also ran Android Lint inspections and tests on my local device as I iterated.

I saw no anomalous behavior, so I now submit this for review and testing.

Things to watch for when testing

  • Completely uninstall any existing Field Day instance, or the permission changes may not be apparent to you as a tester.
  • Check general functionality using both internal and Bluetooth sensor actions, including at least one upload to a remote database
  • Is GPS updating the way it should? It doesn't appear to, and that will need fixed if it's the case.
  • Does everything still work after you force-close and re-launch the app?
  • Issues we may be able to close after this: #27 (closed) #28 (closed) EDIT: also 16? EDIT: not 16

Make any changes you'd like or get in touch with questions/comments/concerns.


Edited by Craig Earley

Merge request reports