I put an AI coding agent inside an Android app. Here’s everything that fought back
Description and use
AndroPI delivers a fully functional AI coding agent on Android, enabling code editing, live preview, terminal access, GitHub integration, and deployment without any external backend.
Problem
Running a full AI coding agent on an Android phone without a backend server.
Outcome
AndroPI delivers a fully functional AI coding agent on Android, enabling code editing, live preview, terminal access, GitHub integration, and deployment without any external backend.
Workflow
- 1. Chose pi, an open‑source TypeScript coding agent.
- 2. Added a Flutter UI front‑end.
- 3. Bundled Node.js, git, ripgrep, ssh, curl, and proot binaries as lib*.so files in the APK.
- 4. Rewrote binary library names with lief to satisfy Android’s packaging rules.
- 5. Implemented a Debian container via proot for full Linux tooling.
- 6. Added DNS‑over‑HTTPS to bypass ISP DNS hijacking.
- 7. Cleaned tool arguments to avoid model‑sent garbage.
- 8. Fixed notification ID conflict in foreground service.
- 9. Reduced APK size by removing unused files and minifying JS.
- 10. Created two build flavors to satisfy Play Store policies (no MANAGE_EXTERNAL_STORAGE, specialUse for foreground service).
Evidence
I built the thing I wanted: AndroPI, an AI coding agent that runs on the phone itself. Open source, MIT, no backend.
Android will not run your binary. Since Android 10 you can't execute files from your app's writable storage.
The binaries come from the Termux package repository. A script downloads the .deb files, pulls the binaries out, and rewrites their library names with lief.
An agent that can't apt install is half an agent. It runs a Debian userland with proot.
My ISP hijacks DNS. The agent's web search kept failing. Turned out the provider was redirecting lookups for sites it doesn't like. I added DNS over HTTPS inside the Node host.
The first release APK was 73 MB. I assumed Flutter was the fat one. It wasn't.
Twice. First: "All files access". Second: the foreground service.
- Record date: 2026-10-02T09:41:09.649Z