We need to target at least Android SDK 31 in order to remain on the Play Store past August 31. The start of this work was completed in https://github.com/azavea/cac-tripplanner-android/pull/210 but there were still some outstanding issues that needed to be addressed. This addresses some of them, but not all (see notes, below).
Demo
Notes
There were a number of issues identified in #209 . Here's a list of the resolutions of each one:
Some of the linting issues point to the deprecation of AsyncTask. Some quick Googling suggests there is no 1-to-1 replacement for this, so we should learn a bit more about fixing these would entail and if it's worth the effort to address this right now.
We have been seeing E/RecyclerView: No adapter attached; skipping layout and E/PlacesList: image view not found; not setting up scroll listener errors for the last couple of versions. Is there an easy fix for this or can it be fixed by a dependency upgrade?
E/libprocessgroup: set_timerslack_ns write failed: Operation not permitted errors appear on API level 28+ following issue #201. To replicate, go to the "places" map view, select an event from the map, or select filter on the map view. These errors appear to be related to the dialogue boxes and map.
I was able to replicate this, but the only discussion I was able to find online indicated that it happens when displaying a dialog over the map (which we do) and that the only solution is to avoid doing that, which would be more effort than we have time for. Luckily, it doesn't seem to harm anything so I think we can safely ignore this.
Google's pre-launch report from releasing the app to testing resulted in the following error java.lang.IllegalStateException: android.os.ServiceManager$ServiceNotFoundException: No service published for: search. We should figure out how to replicate and address this issue.
I wasn't able to replicate this but it seems like there's only one spot in the code that could throw this exception, so I wrapped it in a try/catch and hopefully that'll do the trick.
API level 31 added the ability to share approximate location instead of precise location. The app works if you only share approximate location, but you'll continue to see permissions pop ups and toast messages. We should try to find and fix whatever is checking again and again for precise location and update it to accept approximate location.
I changed the permission checking logic so that it works with either precise or approximate location.
One final note is that SDK is the minimum version to remain on the Play Store, but in order to publish updates we need to target at least SDK 33. We should start on the SDK 33 upgrade as soon as SDK 31 is published.
Testing Instructions
Follow the setup instructions in the README until you've got the app working in an emulator, except don't try to set up a debug API key for the Google Maps API -- just use the release key in the password manager.
Inside the emulator, set a GPS location that is within the Philly area but clearly different from City Hall.
On the first time launching the app, grant it Precise Location permissions and confirm that the map appears in the correct spot (the app sometimes caches the location so if it shows up at City Hall you may need to use the location button to force a refresh, but then it should work correctly).
Use the settings to remove all Location permissions from GoPhillyGo
Launch the app again, but this time use Approximate location, and confirm that the app behaves essentially the same way (though it'll probably jump to City Hall again if the approximate location is too far from Philly).
Overview
We need to target at least Android SDK 31 in order to remain on the Play Store past August 31. The start of this work was completed in https://github.com/azavea/cac-tripplanner-android/pull/210 but there were still some outstanding issues that needed to be addressed. This addresses some of them, but not all (see notes, below).
Demo
Notes
There were a number of issues identified in #209 . Here's a list of the resolutions of each one:
There are a lot of these spots and
AsyncTask
has just been deprecated, not removed, so we should punt until we're less time-crunched. I opened https://github.com/azavea/cac-tripplanner-android/issues/213 for this.We should upgrade eventually but don't need to now because Gradle's maintenance support extends back one major version. In other words, Gradle 7 will only receive support until Gradle 9 is released, but if we're on Gradle 8 then we'll have support until Gradle 10. I opened https://github.com/azavea/cac-tripplanner-android/issues/214 for this.
I did some research on this and my best understanding is that this seems like it could be from calling setAdapter() inside of an asynchronous callback: https://stackoverflow.com/questions/29141729/recyclerview-no-adapter-attached-skipping-layout . It mostly doesn't seem to hurt anything (although I think it might cause some images to be blank when they scroll into view), and we're going to have to rework the asynchronous code soon anyway, so I think it's best to punt on this for the time being. I opened https://github.com/azavea/cac-tripplanner-android/issues/215 to address this.
I was able to replicate this, but the only discussion I was able to find online indicated that it happens when displaying a dialog over the map (which we do) and that the only solution is to avoid doing that, which would be more effort than we have time for. Luckily, it doesn't seem to harm anything so I think we can safely ignore this.
I wasn't able to replicate this but it seems like there's only one spot in the code that could throw this exception, so I wrapped it in a try/catch and hopefully that'll do the trick.
I changed the permission checking logic so that it works with either precise or approximate location.
One final note is that SDK is the minimum version to remain on the Play Store, but in order to publish updates we need to target at least SDK 33. We should start on the SDK 33 upgrade as soon as SDK 31 is published.
Testing Instructions
Closes #209