farey

Comparing ride fares

An Android app that compares all ride-hailing fares in Singapore in just one tap.

My notes

So I’m kind of a cheap skate, so I I download every single ride hailing app to find the cheapest price. When after like opening five different apps, I figured out like, okay, you know, it’s twenty twenty six, why am I still going through and doing all this stuff? But then I realised that this is not a technical thing, this is more, this is not a technical problem, this is more of a it’s intended design that right handling apps do not expose their API and do not make their pricing transparent because it’s not again I guess because it’s not in their interest to be compared. So it wasn’t so as simple as pulling things from API or or from some source and comparing it. So what can I do?

Comparing is a pain

Being a cheapo, I always compare prices on every ride-hailing app before I book. One day, I thought: wait, why can’t I automate this? Turns out I can, but not in a conventional way.

My notes

Since there was no way to connect to direct sources is it I just figure out, you know, why not just automate it like how a human like how I would do it, which means clicking through every app.

For Android, accessibility permissions on screen readers, help out a lot because that means, the app can click on, anything’s on the screen and it can read everything on the screen as well. So by going to different apps, reading what’s on the screen, we can perfectly simulate what I would do already.

And this would would be also really fast because it’s it’s always the we always type the the trip in the same place and we always and the UI is not gonna change much so the app can run determinis de deterministically which means it does not need AI to do anything. It it it’s just inputting things on standard fields every single time.

And this makes it really safe as well because it’s not gonna click on book anything because it literally can’t do that. There’s no space for error.

In an ideal world, I would just find the API for all the right healing apps and then be able to get the prices in a split second. But but this is not the case and and it’s intentional because I don’t think these apps want you to be comparing the prices or having their their pricing so, open to the public.

Since there was no way to get the prices directly, I had to do it the old-fhasioned way.

And try something called accessibility permissions that help, that can read everything on the screen and click on stuff. So the app leveraged on on that to to open up different apps and to type in the trips and read the fares.

I think we can talk about a few things here like the deterministic presses and how you make it go fast. And we can also talk about the different shortcuts we did, like the direct grab link. and one part about skipping screens

talk about deterministic method and how it literally can’t press the book button. and other stuff from my farey thread

Automate it...manually

In an ideal world, I’d just get every ride app’s prices from its API in a split second. But none of them have a public one (intentionally so).

Since there was no way to get the prices directly, I had to automate this the old-fashioned way: simulate opening every app and tapping through it.

Control my phone

On Android, accessibility permissions let an app read everything on the screen and click on anything. So farey can go through each app, type in the trip and read the fare, just like I would.

As quick as possible

100% deterministic, no AI. The trip always goes into the same place, and the apps don’t change much. So farey doesn’t need AI - it just fills in the same fields, every single time. Which also makes it really fast: nothing has to stop and think about where to tap next.

Skip screens. Grab can be opened with a link that already has the pickup and drop-off in it, so farey skips straight to the fares. Across five checks, Grab took 3 seconds on average. The other apps took 12 to 18.

Staying safe

Only does what it’s told. Being deterministic makes it safe too. farey can only follow the steps it was written with: it checks it’s in the right ride app, then taps through only those steps. Not because it’s careful, but because it literally can’t do anything else.

Stop any time. The status bar at the bottom always has a stop button. Press it and farey steps out at once: it stops tapping, the glow and the status bar disappear, and it keeps the fares it already found. Going home or locking the phone does the same.

My notes

The initial build of this felt a bit cold so I said there so I thought, okay, why not let me just make it a bit more fun and I the first thing that came to my mind was the L E D signs on the old Comfort taxis in Singapore and I thought we could play around with that. (I think around here you can look back at the commits I did for Ferry and see what was my exact process because I don’t know whether I stumbled on that idea first or I just did a lot of variations first but otherwise I will just want to build up to, you know, hey, you know, finally I built this.)

And then I just want to showcase the different expressions it has as well. As well as her flying animation.

friendly fare-y

friendly assistant

The first build worked, but it felt too cold. I wanted it to feel more fun - after all, isn’t saving money fun???

The first thing that came to mind was a fare fairy, aka farey. It would take on the blue of Singapore taxis, with an LED display like the Comfort taxis’ roof signs for its face.

A blue ComfortDelGro taxi by the road, its roof sign lit up in green LED letters: TAXI
A ComfortDelGro taxi and its LED roof sign. Photo: S5A-0043, CC BY 4.0.

Since the eyes could convey so much emotion, I used them to show how farey would feel on finding a really cheap ride, or stumbling on a really expensive one.

FUNctional

farey isn’t only there to distract you from the fact that an app is controlling your entire phone - it’s useful too.

Shows every tap. farey flies to each spot just before it’s pressed, so I see every tap coming.

Reacts to every price. farey reacts to each price, and to how the check is going.

Alive in the app. When the check is done, farey lands on the cheapest fare. It also flies around when you tap on it. You can try it below.

My notes

I don’t know ifI should publish this, so I’m just using it as a personal too for now

Personal experiment

For several reasons, I don’t think this will be an easy app to take public. So for now, I’m the sole beneficiary :)

PS: I was surprised by how simple this was. All I had to do was connect my phone to my laptop, turn on debugging mode and then, you know, just let Claude do its work.