GPS trip tracking on an unmapped transit network
Team lead · both Android clients — driver and commuter · 2025–2026
Two native Android clients for Cairo's informal microbus network: five-second GPS streaming from drivers, live tracking and ML-predicted arrival times for commuters.
Training data
Arrival times in these apps come from models trained on Beijing taxi GPS — Microsoft T-Drive, 10,357 trips from 2008–2009 — plus about 500 synthetic Cairo segments. No real Cairo microbus GPS was used. The backend case study sets out what that costs.
The problem
The backend can infer routes from GPS, but the traces have to come from drivers and the answers have to reach commuters. A driver has no reason to broadcast his location all day on a phone and data plan he pays for. A commuter needs to know whether her bus is four minutes away or twenty.
So the two apps are a trade. The driver app asks for location and pays back in points that convert to money. The commuter app turns that stream into a countdown on a map.
What I built
Two native Android apps in Java, sharing an API contract and nothing else.
Driver app. Start a trip and a foreground service streams location every five seconds until it ends. Android's rules for background location changed across versions more than once, so keeping it working was a recurring cost, not a one-off. Around it sit the dashboard, leaderboard, badges, points and withdrawals — the part that makes streaming worth it for the driver.
Commuter app. Pick a route, see which drivers are active on it, track one on a live map, and get an arrival countdown for a chosen pickup point.
The pickup selector. The commuter sets her own pickup point on the route. The driver is told someone is waiting, and she is alerted when he is within 200 metres. That number is tuned, not derived: we started at 100 and moved it out until the alert came early enough to be useful.
Tracking is polling, not push. Firebase handles trip notifications, but the position comes from asking the backend every five seconds. Simple to build, and it scales badly: ten commuters tracking one bus means ten identical requests every five seconds.
The hard decision
Five-second streaming drains battery and costs twelve backend writes a minute per driver. The case for it is that the routes are inferred from the traces, and at coarser intervals a trace turns into straight lines between points.
We tested ten seconds. The map still worked, the traces still clustered, and backend load halved. We shipped five anyway. The test was run to answer a supervisor, not to make a decision, and nobody went back to it.
What I'd do differently
- Act on the ten-second result, or write down why not
- Queue locations offline and upload them when the signal returns
- Test on phones years older than our Oppo A53
- Write client tests — the backend has 42, the apps have none