Skip to content

Remember the last pin, Stop GPS button, find US addresses, get ready for Google Play - #1

Draft
captcrock wants to merge 8 commits into
mainfrom
ccr-b7d0d87f-11zgq5
Draft

captcrock wants to merge 8 commits into
mainfrom
ccr-b7d0d87f-11zgq5

Conversation

@captcrock

@captcrock captcrock commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

After a while, turning TST Go back on dropped the chosen location and jumped to New York. The pin only lived in memory. When Android killed the app in the background, the GPS service restarted itself and broadcast the built-in default (Times Square). Reopening the app did the same. The web app had the same gap and sent Times Square to the browser extension on every reload.

There was also no clear way to stop the fake GPS, and opening the app always started broadcasting.

Searching a home address often found nothing, because OpenStreetMap is missing house numbers for many US homes.

On top of that, Google Play now requires app updates to target Android 16 (API 36). The app targeted 34, so Play would reject an update.

What changed

Android (1.0.10, code 11)

  • LastPin: saves the last pin (lat, lng, name) to SharedPreferences, once a spot has actually been picked. The GPS service restores it when Android restarts it, and the app restores it on open.
  • Never broadcasts the Times Square default. A fresh install leaves the real GPS alone until a spot is picked, and the service skips injecting until a pin is set.
  • Stop GPS, all going through one stop path (StopReceiver / stopFakeGps):
    • red Stop GPS / green Start GPS button on the main screen, replacing the small switch
    • Stop GPS on the ongoing notification
    • long-press icon shortcut Stop GPS
    • TST Go stop button home screen widget
  • The header shows the installed version.
  • Address search:
    • The Search button also asks the US Census Bureau geocoder (free, no key) for anything that looks like a street address.
    • Unit numbers ("Apt 4B", "#12", "Ste. 200") are stripped before searching.
    • Search-as-you-type uses only Photon, biased toward the current pin, after a 450 ms pause.
    • A pending typing search no longer cancels a Search button lookup, or reopens the list after a suggestion is picked.
  • MainActivity is singleTask, and notification/widget "open" taps use the launcher intent. Before, they could open a second copy of the screen, and both copies fed their own spot to the GPS service.
  • Screen text updates only when it changes, instead of 20 times a second.

Google Play readiness

  • compileSdk/targetSdk 36, Android Gradle Plugin 8.9.1, Gradle 8.11.1.
  • Draws edge to edge, with controls padded by the system bar and notch insets.
  • .github/workflows/android-release.yml (manual): builds a signed .aab from repo secrets and can upload it to a Play track. The track defaults to internal, and production uploads always land as drafts.

Web

  • Saves the last broadcast point, so a reload and the extension stay put.
  • Search adds the US Census geocoder for street addresses and strips unit numbers (src/lib/geo/address.ts, with tests).

CI (.github/workflows/android.yml)

  • Builds the debug APK and release bundle, and runs the unit tests.
  • Writes a live report comparing old and new address search on real addresses.
  • Runs .github/scripts/android-smoke.sh on Android 11 and Android 15 emulators, with screenshots.
  • Publishes the APK and results to the ci/android-output branch.
  • Test APKs are signed with one saved key: the TSTGO_TEST_KEYSTORE_BASE64 secret if set, otherwise a key kept in the Actions cache. Each test build then installs over the last one. A cache entry is dropped after 7 days without a build; set the secret to make the key permanent.

Testing

  • Emulator test, commit 9c33780: 0 failed checks on Android 11 and Android 15. After the process is killed and after a force stop, the app reopens at the picked spot. Times Square never reaches the phone's location log. Every stop path works. A search for an address with "Apt 2" lands on the right building, and nothing crashed.
  • Live address report: the new search found 14 of 14 addresses. The old search put "4600 Silver Hill Rd, Washington, DC 20233" in central DC, about 11 km off. The new one finds the building.
  • APK signature checked: the APK is signed with the saved "TST Go test build" key, and the cache step saved that key.
  • Web: unit tests pass and typecheck is clean. The web Census lookup was not run against the live service, because this session can't reach it.
  • Not tested on a physical phone yet.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HUthoCNTkBuCdnW1vT6dVf

The chosen location only lived in memory, so when Android killed the app
in the background (or you reopened it) the GPS service and the map fell
back to the Times Square default. The web app had the same gap and pushed
Times Square to the browser extension on every reload.

Android:
- Save the last pin to disk; the app and the GPS service restore it.
- Stop GPS from outside the app: a button on the notification, a
  long-press icon shortcut (can be pinned to the home screen), and a
  home screen widget. The app screen updates when stopped this way.
- Keep a single app screen so notification/widget taps don't start a
  second copy that broadcasts a different spot.
- Version 1.0.8 (code 9).

Web: persist the last broadcast point so reloads and the extension
stay put. Share links still override it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUthoCNTkBuCdnW1vT6dVf
Compiles the app on every Android change and uploads a debug APK, so
fixes can be checked and installed without a local Android SDK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUthoCNTkBuCdnW1vT6dVf
Google Play now requires app updates to target API 36, and the app
targeted 34, so an upload would be rejected.

- compileSdk/targetSdk 36, Android Gradle Plugin 8.9.1, Gradle 8.11.1.
- Draw edge to edge on every Android version (15+ forces it) and pad the
  top and bottom controls by the system bar and notch insets, with solid
  strips behind the bars so it looks like before.
- Notification and widget "open" taps use the launcher intent, so they
  resume the running app and match its intent filter.
- CI now also builds the release bundle to catch release-only errors.
- New manual workflow builds a signed .aab from repository secrets and
  can upload it to a Play track (internal by default; production is
  always a draft).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUthoCNTkBuCdnW1vT6dVf
@captcrock captcrock changed the title Remember the last pin and add a home-screen Stop GPS Remember the last pin, add Stop GPS from the home screen, get ready for Google Play Oct 29, 2026
- Replace the small broadcast switch with a clear Start GPS / Stop GPS
  button on the main screen.
- Show the installed version in the header so it is obvious which build
  is on the phone. Version 1.0.9 (code 10).
- Never broadcast the built-in Times Square pin: a fresh install leaves
  the real GPS alone until a spot is picked, the spot is only saved once
  one was chosen, and the service skips injecting until a pin is set.
- Update screen text only when it changes instead of 20 times a second.
- CI: run the APK on Android 11 and 15 emulators through the reported
  bugs (pick a spot, app killed, reopened, force-stopped, stop from the
  app, notification and shortcut) with screenshots, and publish the APK
  plus results to the ci/android-output branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUthoCNTkBuCdnW1vT6dVf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUthoCNTkBuCdnW1vT6dVf
OpenStreetMap, which both apps searched, is missing house numbers for
many US homes, so typing a home address often found nothing.

- Search button (Android) and web search also ask the US Census Bureau
  geocoder for anything that looks like a street address. It is free,
  needs no key, and covers nearly every US address.
- Strip apartment and suite numbers ("Apt 4B", "#12", "Ste. 200")
  before searching; they made every lookup miss.
- Android: search-as-you-type uses only Photon (biased toward the
  current pin), waits 450 ms instead of 280 ms, and no longer cancels a
  Search button lookup or reopens the list after picking a suggestion.
- Clearer message when nothing is found.
- Tests: address cleanup unit tests (Kotlin and web), a live CI report
  comparing old and new search on real addresses, and an emulator step
  that searches an address with an apartment number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUthoCNTkBuCdnW1vT6dVf
Each CI run made a new debug key, so every test APK needed the previous
one uninstalled first. Cache the key so later builds update in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUthoCNTkBuCdnW1vT6dVf
The cache step pointed at ~/.android/debug.keystore, which the runner
never creates, so nothing was saved. Create the test key at a known
path (or take it from the optional TSTGO_TEST_KEYSTORE_BASE64 secret),
keep it in the Actions cache, and point the debug signing config at it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUthoCNTkBuCdnW1vT6dVf
@captcrock captcrock changed the title Remember the last pin, add Stop GPS from the home screen, get ready for Google Play Remember the last pin, Stop GPS button, find US addresses, get ready for Google Play Oct 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants