Bytecrab logo
Contact Us
Works  /  Transport  /  Rail ticketing app
Case study · Transport · UK

A UK rail ticketing provider launched NFC tickets a month inside its public-sector deadline

The client's Android app, two years old and built by 10 developers before us, had to become a ticket store and a valid ticket within 7 months. We brought its mixed architecture to one approach, added a purchase flow with NFC smart cards, and released it in 6.

6 moto release, inside a 7-month deadline
5tickets on one NFC card, no phone needed
~20screens in the new purchase flow
Rail ticketing app on Android with a journey planner and a QR ticket
IndustryTransport · rail ticketing
LocationUK
TeamTeam of 14: our Android lead and the client's team
EngagementTime & materials
Duration6 months
StackJava · MVVM · RxJava2 · NFC smart cards
Headline resultReleased a month inside the 7-month deadline
About the client

A UK rail ticketing provider with a journey planner app

The client runs a service that lets rail passengers in the UK buy tickets online and travel on them from their phones, next to train schedules, routes and journey updates. The app was part of a UK government rail project and sells tickets for several train operators.

The app already had around 500,000 active users when the client decided to sell tickets in it and make the phone the ticket.

Need to add payments, tickets or NFC to an app that is already live? The same work applies: build the new flow on its own, plug it in where users already are, and keep the core untouched.

7 modeadline set by a public-sector obligation
5tickets on one NFC card
10developers had built the app before us
The challenge

Turn a journey planner into a ticket store and a ticket, in 7 months

Passengers planned trips in the app but bought tickets somewhere else. The client had a public-sector obligation to change that within 7 months: sell tickets in the app, let passengers travel on a phone or an NFC card, and add no technical debt to an app that two years of work by 10 developers had already made hard to change. Switching to an off-the-shelf ticketing app wasn't an option: 500,000 passengers already used this one, and the obligation was to sell tickets in it.

Business

One app to plan, buy and travel

The client wanted new passengers through online purchase and mobile tickets, with tickets from several train operators in one place. Until then, passengers had to buy at the station or through another service.

Technical

Legacy code and closed SDKs

The code mixed several architecture approaches. NFC cards and the backend each ran through a third-party SDK: both closed, with custom data formats and non-standard handling. Card upload had to work on older Android devices too.

Delivery

A fixed date, a live app, a mixed team

Buying had to work from saved routes, trip history, the schedule and the journey planner, about 20 screens in all. New logic needed unit tests, and the old unit tests had to keep passing. The Android developers had different levels of experience, and the deadline could not move.

Cost of waiting: missing the deadline put the client's public-sector contract at risk, and passengers would have kept queuing at stations for tickets.

The date came from the authority, not from us. We needed a team that would solve the NFC problem, not send it back to us.Head of Digital, the client
Why ByteCrab and how we worked

One architecture first, then the purchase flow and NFC

Native Android with hardwareWe build native Android apps that work with hardware, like the scanner apps we run for a print and fulfilment group.
We keep the hard problemsWe debugged the closed SDKs and worked with their vendors' support ourselves, instead of handing problems back to the client.
Our developer led the Android teamOur developer split the tasks across the Android team and handled communication with product management.
Month 1

One architecture

MVVM and Data Binding as the base, with base classes that also work with the old code.

Month 2–3

Purchase and QR tickets

Buying from routes, history, the schedule and the planner. QR tickets stored in the app.

Month 4–5

NFC card upload

Up to 5 tickets written to the card, with our fix for the SDK.

Month 6

Release

Testing on older devices, then release a month before the deadline.

The solution

A ticket store and a ticket in the app passengers already had

Passengers buy where they plan the trip and travel on a QR code or an NFC card. Each part below closes one of the three challenges.

Ticket purchase screen opened from a saved route in the rail app
Buying a ticket straight from a saved route
Closes the business challenge

Buy a ticket from anywhere in the app

Passengers buy tickets where they already are: saved routes and favourite places, trip history, the train schedule, or while planning a new journey. After payment the app creates a QR code, and the passenger shows it to the conductor. There is no limit on how many QR tickets the app can store, and tickets from several train operators sit in one place.

  • Purchase from routes, history, schedule and planner
  • Unlimited QR tickets stored in the app
  • Tickets from several operators in one app
Phone held to an NFC card to upload rail tickets
Tickets move to the NFC card with one tap of the phone
Closes the technical challenge

NFC card upload that works on older phones

A passenger who buys tickets for future trips can send up to 5 of them to a physical NFC card by holding the phone to it. At the station they tap the card on the reader. No internet, no charged phone. The SDK behind the cards is closed and handles data in its own way. We found the failures through trial, error and debugging, worked through them with the vendor's support team, and wrote our own fix that made upload stable, even on older devices.

  • Up to 5 tickets on one card
  • Travel without internet or a charged phone
  • Stable upload on older Android devices
Decision: we took the SDK problems and the talks with the vendors' support on ourselves, so the client's team didn't lose time on them.
Entry pointsRoutes, history, schedule, planner
Purchase flowAbout 20 screens in one module
TicketQR code in the app or NFC card
ReleaseMonth 6 of 7
Closes the delivery challenge

One architecture without a rewrite, and a purchase flow beside it

A full refactor of two years of code would not fit the deadline. We made MVVM with Android Data Binding the base, with ViewModels injected through Dagger2, and wrote base classes that work with the older approaches too, even Data Binding and Butterknife on the same screen. Old screens kept working with small changes, and the old unit tests kept passing. The purchase flow was built as one module of about 20 screens, with the NFC logic inside, covered with unit tests and connected to each place a passenger can start buying. Our developer also led the Android team: split the tasks and handled communication with product management. The release came in 6 months against a 7-month deadline.

  • One base architecture, no big refactor
  • Old unit tests passing, new logic covered
  • A month to spare before the deadline
Decision: shared base classes that work with old and new code, instead of rewriting the legacy screens.
Results

What changed for passengers and for the client

6 moto release, a month inside the 7-month deadline
32%of all tickets bought through the app within 6 months of launch
5tickets on one NFC card, usable without a phone
AreaBeforeAfter
Buying a ticketOutside the appFrom routes, history, schedule and planner
Ticket on the journeyPaper ticket or station machineQR code in the app or an NFC card
Travel without a phoneNot possible with a mobile ticketUp to 5 tickets on an NFC card
Train operatorsTickets bought per operatorSeveral operators in one app
ArchitectureSeveral approaches mixedOne MVVM base, old code still working
Unit testsOld tests onlyOld tests passing, new flow covered
NFC uploadUnstable with the vendor's SDKStable, including older devices
Delivery7-month deadlineReleased in 6 months
Sell a ticket on every screen where a trip is planned.
Let passengers travel without a charged phone.
Sell several operators' tickets in one app.
Passengers stopped asking where to buy a ticket. They buy it on the same screen where they plan the trip.Head of Digital, the client

Adding tickets or NFC to a live app? Tell us your deadline, and we'll tell you what fits in it.

What we delivered

Features in daily use

Ticket purchase anywhere

From saved routes, history, the schedule or the journey planner.

QR tickets

Unlimited tickets stored in the app, shown to the conductor.

NFC card upload

Up to 5 tickets on a physical card, tapped at the station reader.

Several operators

Tickets from other train companies in the same app.

Journey planning

Schedules, routes and journey updates next to the tickets.

Purchase module

About 20 screens in one module, separate from the app's core.

Tech stack

What it runs on

App
Native AndroidJavaMVVMAndroid Data BindingDagger2RxJava2RetrolambdaUnit tests
Data
Retrofit2OkHttp3RealmFirebaseBackend SDK
Device and maps
NFCSmart card SDKBluetoothGoogle MapsQR codes
We came to ByteCrab with a fixed date and an NFC SDK nobody could explain. They shipped a month early and never sent a problem back to us. When something broke, they came back with the fix.
Head of DigitalRail ticketing provider, UK

Tell us more about yourself

Extensions: .pdf, .doc/.docx, .ppt/.pptx, .xls/.xlsx
ByteCrab in numbers
12+

years solving real-world tech challenges

150+

products shipped and scaling

20+

countries where our clients run and grow their products

USM logo Vodaphone logo Cultivist logo Galka IF logo

Project inquiries

hello@bytecrab.com

Phone number

+38 095 537 6119