// blog · Build

Building FoodPal, Part 1: AI scaffolds a privacy tracker

Why build this

Privacy is a dial, not a switch. You can't turn it on and be completely private, and you can't turn it off and be completely exposed. It's little steps. One of those steps is replacing the utility apps you use every day, the ones that track every byte of your data, with open source alternatives that don't.

I got into developing Android apps to solve problems I had day to day, and the apps I found on the Google Play Store and iOS were, frankly, spyware. If the app is free, you're the product. It tracks every bit of your data, sends it to servers you don't control, and sells it to whoever will pay. That's the deal you accept when you install it.

A fitness tracker is one of the worst offenders. The big one, the one that pretends to be your pal, takes your most personal data. The days you don't feel good, the foods you eat, the bad choices you make, your weight that week. It hoovers up data from other apps on your phone and sends it all off to be sold. A fitness tracker app doesn't have to be that. It doesn't have to go to somebody else's server.

Google's developer ID requirement

I tried to put my open source apps on the Google Play Store, and it turns out you can't really do that anymore. Not as a regular person. Google now wants your government ID to publish as a developer, whether you're an individual, a small company, or even a large corporation. Somewhere inside Chase or NatWest, there's someone whose job it is to hand their driving licence over to Google.

Google's motivation is clear: they want to be able to point a finger at someone when something goes wrong, and they want to track the developer ecosystem. It's incredibly dystopian, and there's not much we can do about it. We're not going to start our own app store. But what we can do is build the apps differently and distribute them through F-Droid instead, the open source alternative app store for Android.

The plan: FoodPal

FoodPal is a macronutrient and fitness tracker. It's built in Kotlin with Jetpack Compose, native Android, not a cross-platform framework like Flutter or React Native. It runs on regular Android phones and on GrapheneOS without using any of Google's proprietary libraries. No Firebase, no Play Services integration, no telemetry.

All your data, logged food, calories, activity, history, is stored on the device in a Room database. The app talks to a hosted mirror of Open Food Facts for barcode scanning, but that server only answers food queries; it never takes data the other way. The code will be open source on GitHub so anyone can verify that claim. The macros and calories are just maths, formulas we put in the app. No cloud required.

Building with AI

I wrote a markdown document describing what the app should do: the sign-up flow, the dashboard with calories and macros, the food logging page with a date carousel, the custom foods CRUD, and the settings. Page by page, section by section. Then I fed it to an AI coding tool.

I use Open Code, an open source front end, with GLM 5.2, an open source model. The advantage of a terminal-based coding agent over a web chatbot is that it writes the files directly, runs the build commands, and manages the whole process. You don't copy code back and forward. You act more like a conductor. The orchestra sounds terrible and is a bit loud, but it's still faster than doing it by hand over months.

I've done this before. I built a device tracker app, a self-hosted alternative to AirTags, using the same method. Closed source, encrypted between phone and server, with a dashboard my family can access. I outlined the entire app in a markdown file, fed it to the AI, and built it in a day. It's released and running.

The scaffold

The AI scaffolded the project in Kotlin, set up the Room database schema, built the sign-up screen, the dashboard, and the food logging page. The build command produces an APK, the installable file you'd normally get from Google Play. I transfer it to a phone over USB to test.

I couldn't compile on this machine because I'm running NixOS, and the Android tools don't play well with it. But NixOS is great everywhere else. Servers, configuration management, reproducibility. Once you get past the Nix pills, you never go back.

The next step is the food logging page. Date carousel, meal cards, search, custom foods, and copy actions. I keep adding features through the series and wiring up the database in the background. Part two is already up. We put the APK on a phone and demo it live.

FoodPal Android Kotlin Open Code AI Coding
← Back to blog