Android case study
Building an Android app for Arabic first
Most apps in our region are translated into Arabic. Wasfetna is a recipe app I built the other way round: Arabic first, English second.
- Project
- Solo and personal, AI-assisted
- Stack
- Kotlin, Jetpack Compose, Hilt, Coroutines, Firebase
- Languages
- Arabic and English
- Live on
- Google Play and Huawei AppGallery
Text that doesn't assume who is reading
Arabic has no gender-neutral command. A button has to pick a man or a woman. Early on, my app did both, depending on when I built each screen.
I don't keep separate strings for men and women. I rewrote the text so it addresses nobody:
A small script scans the Arabic text, and the release check fails if it finds a verb that addresses a man or a woman. Part of it is a word list, so it can miss things. It catches most slips before users see them.
One exception is deliberate: the Home row اطبخها مجددًا keeps the command, because the verbal noun طبخها reads as "he cooked it".
Arabic needs more room than fonts admit
On the Wasfetna website, Chrome cut the dots under a final ي, so الإلكتروني read الإلكترونى. The font declared 4px below the line, but the dots reached about 9px.
I measured it instead of guessing. On a 54px text box, a line height of 53px still cut the dots, and 54px fixed them. The rule: the box needs a fixed height, and a line height at least that tall.
The Android app has a version of this too. Compose can trim the space above and below a line, so I turn trimming off for every Arabic text style.
Numbers don't follow the screen
Arabic runs right to left, but numbers don't. The code input keeps left-to-right order on Arabic screens, so the digits fill in the expected order.
A number can also change the word beside it. It's 5 وصفات but 12 وصفة, so recipe, dish and minute counts use Android's plural resources, and a test checks them.
Performance, measured on a real phone
I quote a speed number only if a benchmark produced it on a named phone. Cold start and recomposition come from Macrobenchmark runs on a Galaxy A54. The data figure comes from the phone's network counters on a Galaxy A35.
| What changed | Before | After |
|---|---|---|
| Median cold start to first frame, with a Baseline Profile (September 2026 run) | 509 ms | 431 ms |
| Recomposition per frame, scrolling search results | 1.9 ms | 0.03 ms |
| Data for a fresh install | 6.4 MB | ~1.5 MB |
The recomposition fix was simple: the list saved its scroll position into shared state on every frame. It now hands the position over once, when the screen closes.
One app, two stores
Wasfetna ships Google and Huawei builds from one codebase, with unit, UI and screenshot tests. Huawei devices have no Play Services, so I wrote a custom Firebase App Check provider for them, verified on the server by a Cloud Function.
How I used AI
I built Wasfetna with Claude Code and Codex. I use them for implementation, refactoring and code review. I review every change myself and check it with tests and benchmarks, because I own what ships.