|
| 1 | +# AKL Live |
| 2 | + |
| 3 | +An Android app for live Auckland Transport buses and trains, built for the |
| 4 | +Galaxy S26. It's the phone version of |
| 5 | +[akl-departure-board](https://github.com/intelarc/akl-departure-board), the |
| 6 | +ESP32 desk display. |
| 7 | + |
| 8 | +## Install |
| 9 | + |
| 10 | +Open **Releases → latest** on the phone, download `AKL-Live.apk` and open it. |
| 11 | +Android asks once to allow installs from your browser. Every push to `main` |
| 12 | +builds a new signed APK there. Installing it updates the app in place. |
| 13 | + |
| 14 | +## Buses |
| 15 | + |
| 16 | +The 27H at Aldersgate Road, Hillsborough, both directions: stop 8669 to |
| 17 | +Britomart and 8664 to Waikowhai. Stops and route can be changed in Settings. |
| 18 | + |
| 19 | +- **A live scene per direction.** The bus drives toward the stop as its arrival |
| 20 | + counts down, and its wheels turn while it's moving. The sky follows the real |
| 21 | + time of day: sunrise, the sun's arc, sunset, then stars and a crescent moon, |
| 22 | + with lit windows and the Sky Tower's beacon. The city lane has the Auckland |
| 23 | + skyline; the Waikowhai lane has houses and pōhutukawa in flower. |
| 24 | +- **The next bus in detail.** It shows the expected arrival against the |
| 25 | + timetable, on time or minutes late, and how many stops away the bus is. From |
| 26 | + its GPS it also shows how far away it is in km, its speed, how full it is, |
| 27 | + and its fleet number. |
| 28 | +- **The next five buses** with live and scheduled times. |
| 29 | +- **A live map of the whole 27H.** Both directions are drawn from the stops' |
| 30 | + real positions, with every bus on its way to you pointing where it's |
| 31 | + heading, tagged with its countdown. |
| 32 | + |
| 33 | +## Trains |
| 34 | + |
| 35 | +A live map of the post-CRL network, drawn after AT's official "Ngā Tereina" |
| 36 | +map. It has the red City Rail Link loop (Waitematā, Te Waihorotiu, |
| 37 | +Karanga-a-Hape, Grafton, Newmarket, Parnell), and E-W and O-W run side by side |
| 38 | +out west. Harbours and volcanic cones sit behind it. |
| 39 | + |
| 40 | +- **Every train, live.** Markers glide between GPS fixes, show their direction |
| 41 | + of travel, and carry an orange or red dot when a train is running 2 or 5+ |
| 42 | + minutes late. |
| 43 | +- **Pinch, pan and double-tap to zoom.** All 44 station names appear as you |
| 44 | + zoom in, placed so they never overlap. |
| 45 | +- **Tap a train** for its destination, speed, delay, how full it is and its |
| 46 | + carriage number. You also get its next ten stops with expected times. |
| 47 | +- **Tap a station** for live departures from every platform, with line, |
| 48 | + destination, delay and countdown. |
| 49 | +- **Line filters** (E-W, S-C, O-W) with live counts, and a network overview |
| 50 | + showing how many trains on each line are running late. |
| 51 | +- Light and dark map, following the system theme. Landscape puts the map |
| 52 | + beside the panel. |
| 53 | + |
| 54 | +## How it's built |
| 55 | + |
| 56 | +Kotlin + Jetpack Compose. Everything is drawn with Compose Canvas, with no |
| 57 | +map or chart libraries. Data comes straight from the |
| 58 | +[AT developer API](https://dev-portal.at.govt.nz): |
| 59 | + |
| 60 | +| What | Endpoint | |
| 61 | +|---|---| |
| 62 | +| Stop timetable | `gtfs/v3/stops/{id}/stoptrips` | |
| 63 | +| Live delays, stops away | `realtime/legacy/tripupdates?tripid=` | |
| 64 | +| Bus and train GPS | `realtime/legacy/vehiclelocations?tripid=` / `?vehicleid=` (all trains are 59xxx) | |
| 65 | +| Train destination and stops | `gtfs/v3/trips/{id}` and `.../stoptimes` | |
| 66 | +| Station departures | stoptrips for each platform (platforms from `parent_station`) | |
| 67 | + |
| 68 | +Train GPS fixes are snapped onto the nearest station-to-station stretch of the |
| 69 | +train's own line on the schematic. `tools/gen_data.py` generates the map |
| 70 | +geometry, the station/platform table and the 27H's stop lists into |
| 71 | +`app/src/main/java/nz/aryan/akllive/data/`: |
| 72 | + |
| 73 | + AT_API_KEY=... python tools/gen_data.py |
| 74 | + |
| 75 | +The app polls only while it's on screen: buses every 30 s, trains every 15 s. |
| 76 | + |
| 77 | +## Building |
| 78 | + |
| 79 | +GitHub Actions builds `app-release.apk` on every push (`.github/workflows/build.yml`). |
| 80 | +It uses three repository secrets: |
| 81 | + |
| 82 | +- `AT_API_KEY`: built into the APK as the default key (Settings can override it) |
| 83 | +- `KEYSTORE_B64`, `KEYSTORE_PASSWORD`: the signing key. It's kept locally in |
| 84 | + `signing/`, which is gitignored. Back it up: updates must be signed with |
| 85 | + the same key. |
| 86 | + |
| 87 | +Local builds need JDK 17, the Android SDK and Gradle 8.11: |
| 88 | +`gradle :app:assembleRelease`. Without the secrets, you get a debug-signed |
| 89 | +APK with no built-in key. |
| 90 | + |
| 91 | +Not affiliated with Auckland Transport. |
0 commit comments