11# AKL Live
22
3- An Android app for live Auckland Transport buses and trains, built for the
4- Galaxy S26. It's the phone version of
3+ Live Auckland buses, trains and ferries on Android, built for the Galaxy S26.
4+ It's the phone version of
5+ [ AKL Live for Windows] ( https://github.com/intelarc/akl-live-desktop ) (the same
6+ app, running in a WebView), and a cousin of
57[ akl-departure-board] ( https://github.com/intelarc/akl-departure-board ) , the
68ESP32 desk display.
79
@@ -16,118 +18,64 @@ The app needs an Auckland Transport API key, and none is built in. Sign up at
1618to the GTFS and realtime APIs, and paste your key in the app's Settings. The
1719app opens on Settings until a key is set.
1820
19- ## Buses
20-
21- The 27H at Aldersgate Road, Hillsborough, both directions: stop 8669 to
22- Britomart and 8664 to Waikowhai. Stops and route can be changed in Settings.
23-
24- - ** A live scene per direction.** The bus drives toward the stop as its arrival
25- counts down, and its wheels turn while it's moving. The sky follows the real
26- time of day: sunrise, the sun's arc, sunset, then stars and a crescent moon,
27- with lit windows and the Sky Tower's beacon. The weather is Auckland's real
28- weather ([ Open-Meteo] ( https://open-meteo.com ) ): cloud cover greys the sky, and
29- it drizzles, rains, fogs over or flashes with thunder when Auckland does. The
30- city lane has the skyline with Rangitoto behind; the Waikowhai lane has houses,
31- pōhutukawa in flower and Maungakiekie's obelisk.
32- - ** The next bus in detail.** It shows the expected arrival against the
33- timetable, on time or minutes late, and a track of the stops between the bus
34- and you with the last one it passed. From its GPS it also shows how far away
35- it is in km, its speed and how full it is.
36- - ** What bus is coming.** The fleet number in AT's feed (` TR3884 ` , ` NB5760 ` )
37- gives the operator and, where the fleet list knows it, the model: a CRRC
38- eT12 MAX, an eD12 MAX double-decker, an Enviro200... Electric buses get a ⚡,
39- and the scene draws the right bus (double-deckers, no exhaust on electrics).
40- - ** The next five buses** with live and scheduled times and models.
41- - ** A live satellite map of the whole 27H.** Both directions over real aerial
42- photos (or a street map), every bus on its way to you gliding between GPS
43- fixes and pointing where it's heading. Tap it for full screen, then tap a bus
44- to see what it is. Pull down anywhere to refresh.
45-
46- ## Live
47-
48- Every bus in Auckland on one map, about a thousand at a time, coloured by
49- operator and gliding between GPS fixes. Zoom in and each one shows its heading
50- and route number.
51-
52- - ** Search** by route (` 27 ` finds the 27H, 27W and 27T), fleet number
53- (` NB5075 ` ) or model (` eT12 ` ), and the map frames what it found.
54- - ** Filters** for electric buses, double-deckers or one operator, with live counts.
55- - ** Tap a bus** for its route and destination, how late it's running, its
56- speed, how full it is and what model it is. Tap the model for its page.
57-
58- ## Fleet
59-
60- Every bus model on the network (the CRRC eT12 MAX, Geely C13E, Enviro500 and
61- the rest), sorted by how many are out right now.
62-
63- - ** Each model has its own page:** a drawing of it (double-deckers, tri-axles,
64- electrics), specs such as length, seats, motor and top speed, a short
65- history, the fleet numbers each operator uses, and a live map of every one of
66- them on the road, with a list you can tap to find each bus.
67- - Buses whose fleet numbers aren't in the list yet are grouped under ** Not
68- identified yet** , with their own map.
69-
70- ## Trains
71-
72- A live map of the post-CRL network, drawn after AT's official "Ngā Tereina"
73- map. It has the red City Rail Link loop (Waitematā, Te Waihorotiu,
74- Karanga-a-Hape, Grafton, Newmarket, Parnell), and E-W and O-W run side by side
75- out west. Harbours and volcanic cones sit behind it.
76-
77- - ** Every train, live.** Markers glide between GPS fixes, show their direction
78- of travel, and carry an orange or red dot when a train is running 2 or 5+
79- minutes late.
80- - ** Pinch, pan and double-tap to zoom.** All 44 station names appear as you
81- zoom in, placed so they never overlap.
82- - ** Tap a train** for its destination, speed, delay, how full it is and its
83- carriage number. You also get its next ten stops with expected times.
84- - ** Tap a station** for live departures from every platform, with line,
85- destination, delay and countdown.
86- - ** Line filters** (E-W, S-C, O-W) with live counts, and a network overview
87- showing how many trains on each line are running late.
88- - ** Diagram, Satellite or Map.** Switch from the schematic to every train at
89- its real GPS position over aerial photos or a street map.
90- - Light and dark map, following the system theme. Landscape puts the map
91- beside the panel.
21+ ## What's in it
22+
23+ Everything the Windows app has, laid out for a phone: tabs along the bottom,
24+ and the map screens' panels as sheets over the map.
25+
26+ - ** Directions.** Plan any trip across Auckland by bus, train and ferry, from
27+ saved places, stops or any address, leaving now, at a time or arriving by.
28+ Each option shows its legs, live delays, which bus it is (model, operator,
29+ fleet number) and where it is now, with turn-by-turn walking. ** Remind me to
30+ leave** sends a notification. The planner runs on the phone, over AT's full
31+ timetable.
32+ - ** Stops.** Search any stop, station or wharf; live departures on every route
33+ with delays, stops away and the model; approaching buses on the map.
34+ - ** Buses.** The 27H at Aldersgate Road, both ways, each with a live scene
35+ under Auckland's real sky and weather; "leave in 3 min", the next buses,
36+ the rest of today, a live route map and the weather ahead. Tap the bell for
37+ a notification before your bus.
38+ - ** Trains.** The whole network in AT's line colours along the real tracks,
39+ every train where its GPS puts it; tap one for its next stops, or a station
40+ for every platform's departures.
41+ - ** Live.** Every bus in Auckland on one map (plus trains and ferries), with
42+ search by route, fleet number or model, and Follow.
43+ - ** Fleet.** Every bus model on the road and how many are out, each with its
44+ own page and live map.
45+ - ** Alerts.** Every current and upcoming disruption, yours first.
46+ - ** Maps.** Satellite (Esri, or LINZ's 7.5 cm aerials with a free key) with
47+ streets and 3D buildings over them, or OpenFreeMap's street map; 3D terrain.
48+ - ** Search everything** from the Search tab: places, stops, routes, fleet
49+ numbers and models.
9250
9351## How it's built
9452
95- Kotlin + Jetpack Compose. The scenes, the train diagram and the vehicle
96- markers are drawn with Compose Canvas. The real maps are
97- [ MapLibre] ( https://maplibre.org ) (open source), with:
53+ The app is the desktop app's web pages (plain JS, no framework) in a WebView:
9854
99- - satellite: [ Esri World Imagery] ( https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9 ) ,
100- or with a free [ LINZ Basemaps] ( https://basemaps.linz.govt.nz ) key, Toitū Te
101- Whenua LINZ's aerial photos (7.5 cm in Auckland, CC BY 4.0). Paste a key in
102- Settings.
103- - streets: [ OpenFreeMap] ( https://openfreemap.org ) (OpenStreetMap data).
55+ - ` app/src/main/assets/web/ ` is a copy of
56+ [ akl-live-desktop] ( https://github.com/intelarc/akl-live-desktop ) 's ` src/ ` .
57+ Don't edit it here: change the desktop app, then bring it over with
10458
105- Transit data comes straight from the
106- [ AT developer API] ( https://dev-portal.at.govt.nz ) :
59+ python tools/import_desktop.py [path to akl-live-desktop]
10760
108- | What | Endpoint |
109- | ---| ---|
110- | Stop timetable | ` gtfs/v3/stops/{id}/stoptrips ` |
111- | Live delays, stops away | ` realtime/legacy/tripupdates?tripid= ` |
112- | Bus and train GPS | ` realtime/legacy/vehiclelocations?tripid= ` / ` ?vehicleid= ` (all trains are 59xxx) |
113- | Train destination and stops | ` gtfs/v3/trips/{id} ` and ` .../stoptimes ` |
114- | Station departures | stoptrips for each platform (platforms from ` parent_station ` ) |
115- | Every bus (Live, Fleet) | ` realtime/legacy/vehiclelocations ` , the whole feed (~ 80 KB gzipped) |
116- | Bus operator and model | the vehicle label (` TR3884 ` ) looked up in ` app/src/main/assets/fleet.tsv ` and ` models.json ` |
61+ That also adds the phone layer from ` tools/android-web/ ` : ` mobile.css `
62+ (bottom tabs, bottom sheets, one-column grids) and ` android.js ` (the back
63+ button, notifications, keys carried over from older versions).
64+ - ` MainActivity.kt ` is the shell. It serves the pages from the APK at
65+ ` https://appassets.androidplatform.net/web/ ` , and stands in for the desktop
66+ app's main process: it downloads AT's timetable (` gtfs.zip ` , ~ 29 MB, which
67+ has no CORS headers) for the journey planner, checks it every six hours and
68+ keeps it for offline, and turns web notifications into Android ones.
69+ - Settings (your stops, keys, theme) live in the WebView's storage, like the
70+ desktop app's.
11771
118- Train GPS fixes are snapped onto the nearest station-to-station stretch of the
119- train's own line on the schematic. ` tools/gen_data.py ` generates the map
120- geometry, the station/platform table and the 27H's stop lists into
121- ` app/src/main/java/nz/aryan/akllive/data/ ` :
72+ The pages poll AT only while the app is on screen, so bus alerts and "remind
73+ me to leave" fire while it's open.
12274
123- AT_API_KEY=... python tools/gen_data.py
124-
125- The app polls only while it's on screen: buses every 30 s, trains every 15 s,
126- and the whole network every 20 s, only while Live or Fleet is open.
127-
128- AT's feed reports train speeds in m/s, as GTFS-realtime specifies, but bus
129- speeds in km/h. Both were checked against how far vehicles actually moved
130- between fixes.
75+ The desktop app's shared data comes from this repo: its
76+ ` tools/import_android.py ` reads the train network and the 27H's stops
77+ (` app/src/main/java/nz/aryan/akllive/data/ ` , generated by
78+ ` AT_API_KEY=... python tools/gen_data.py ` ) and the fleet list below.
13179
13280### The fleet list
13381
@@ -156,9 +104,6 @@ It uses these repository secrets:
156104 ` signing/ ` , which is gitignored. Back it up: updates must be signed with
157105 the same key.
158106
159- The Screenshots workflow (run it by hand) drives every screen in an emulator
160- with live data; pick ` build ` to shoot a branch instead of the latest release.
161-
162107Local builds need JDK 17, the Android SDK and Gradle 8.11:
163108` gradle :app:assembleRelease ` . Without the signing secrets, you get a
164109debug-signed APK.
0 commit comments