Skip to content

Mass Schedule Distribution & Tablet Remote Start Protocol#31

Merged
listingclown3 merged 2 commits intorebuiltfrom
copilot/add-mass-schedule-distribution
Apr 9, 2026
Merged

Mass Schedule Distribution & Tablet Remote Start Protocol#31
listingclown3 merged 2 commits intorebuiltfrom
copilot/add-mass-schedule-distribution

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 8, 2026

Summary

Implements the two-part Replay System integration described in the problem statement.


Part 1 — Schedule Distribution

How it works:

  1. Admin generates a Schedule QR from the admin panel and presses "Show Tablet QR Code"
  2. Scout opens the Schedule screen, presses "Scan Schedule QR"
  3. App scans the QR, parses { server_ip, port, comp_code, year }, stores all fields persistently
  4. Constructs https://{ip}:{port}/schedule/{year}{comp_code}_matches.csv and downloads it automatically
  5. Downloaded CSV is saved to internal storage and immediately applied as the active schedule

Error handling (non-obtrusive Toasts):

  • 403 → "Schedule download disabled. Ask field crew to re-enable it."
  • 404 → "Schedule file not found on server."
  • Network error → "Cannot reach replay server. Verify WiFi connection."

HTTPS / self-signed cert: Uses a trust-all X509TrustManager (required for LAN self-signed certs per spec). The HostnameVerifier validates against the configured server IP to prevent connecting to unknown hosts.


Part 2 — Remote Start

How it works:

  1. Scout opens Settings → Replay Remote Start, presses "Scan Remote Start QR"
  2. App scans the QR, parses { auth_key, start_url, server_ip, port }, stores all fields persistently
  3. Scout enables the "Enable Remote Start" toggle
  4. All four values (IP, port, auth key, start URL) are also manually editable in Settings
  5. On the Info tab, a red "▶ Start Recording" button appears
  6. Pressing it: immediately navigates to the Auto tab, then fires POST {start_url} with { auth_key } asynchronously
  7. Result shown as a brief Toast — fire-and-forget, scouting is never blocked

Swipe lock: When remote start is enabled, swiping from the Info tab to Auto is blocked — the scout must press the Start Recording button (which fires the remote start) to advance. Tab-bar clicks still allow free navigation.

Error handling (non-obtrusive Toasts):

  • 200 → "✓ Recording started"
  • 401 → "QR code expired — scan a new Remote Start QR"
  • 409 → "Already recording"
  • -1 (no config) → "Scan the Remote Start QR in Settings first"
  • Network error → "Cannot reach replay server"

Changes

New files

  • ReplayServerManager.java — singleton managing server config persistence, CSV download, and remote start POST
  • NonSwipeableViewPager.java — custom ViewPager that blocks swipe on Info tab when remote start is enabled

Modified files

  • AndroidManifest.xml — added INTERNET, CAMERA permissions; usesCleartextTraffic
  • ViewScheduleActivity.java — QR scan button, CSV download flow
  • activity_view_schedule.xml — added Scan QR and Remove Schedule buttons side-by-side
  • SettingsActivity.java — remote start QR scan, persist config, manual edit fields
  • root_preferences.xml — new "Replay Remote Start" preference category
  • ScoutingFormActivity.java — configure swipe lock on resume, navigateToAutoTab() helper
  • activity_scouting_form.xml — replaced ViewPager with NonSwipeableViewPager
  • UIInfoFragment.java — Start Recording button, fire remote start, navigate to Auto
  • ui_fragment_info.xml — added Start Recording button (GONE by default)
  • strings.xml — all new user-facing strings
  • colors.xml — added md_black_1000, md_red_700

Copilot AI requested a review from listingclown3 April 8, 2026 20:08
@listingclown3 listingclown3 marked this pull request as ready for review April 9, 2026 00:36
@listingclown3 listingclown3 merged commit d096a37 into rebuilt Apr 9, 2026
@listingclown3 listingclown3 deleted the copilot/add-mass-schedule-distribution branch April 9, 2026 01:03
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