Field-tested rules for native Android apps (Kotlin, Jetpack Compose, Gradle). Load it BEFORE answering any Android task or question, even a short how-to: writing or debugging app code, Room and sync, notifications and alarms, permissions, widgets, sign-in, billing, tests, release builds and R8, and anything that runs adb, Gradle device tasks or installs on an emulator or a real phone. It holds fixes for bugs that look fine in debug and fail in release or on a device, and safety rules that kee...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Android?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tahacan3-android)
---
name: android
description: "Field-tested rules for native Android apps (Kotlin, Jetpack Compose, Gradle). Load it BEFORE answering any Android task or question, even a short how-to: writing or debugging app code, Room and sync, notifications and alarms, permissions, widgets, sign-in, billing, tests, release builds and R8, and anything that runs adb, Gradle device tasks or installs on an emulator or a real phone. It holds fixes for bugs that look fine in debug and fail in release or on a device, and safety rules that keep the user's phone data from being wiped (signature mismatches, uninstall, connectedAndroidTest). Also covers architecture, networking, DataStore, CI, performance, and Google Play launch. Includes scripts to sign a release APK with the debug key, drive the UI by visible text, scan logcat for crashes and back up app data on an emulator."
---
# Android app development
A field-tested way to build a Kotlin + Jetpack Compose app from an empty folder to a Play Store release. Every rule
here comes from a real app (a habit and health tracker with reminders, widgets, sync, subscriptions and an AI
backend) and most carry the bug that taught it. Version numbers are examples from late 2026; check the current
releases before pinning.
## How to use this skill
1. Read the project's own `CLAUDE.md` first. Project rules (language of identifiers, approval rules, device serials)
win over this skill.
2. Pick the workflow below that matches the request.
3. Open only the reference files the workflow points to. Each one is self-contained.
| Topic | Reference |
| --- | --- |
| New project, Gradle, version catalog, build types, local secrets | [references/project-setup.md](references/project-setup.md) |
| Layers, manual DI or Hilt, Room, migrations, DataStore settings, Flows, coroutines | [references/architecture-and-data.md](references/architecture-and-data.md) |
| HTTP APIs: Retrofit or Ktor, OkHttp, errors, offline first, auth headers, MockWebServer | [references/networking.md](references/networking.md) |
| Compose screens, navigation, strings, plurals, locales, themes, tablets and foldables, accessibility, motion | [references/compose-ui.md](references/compose-ui.md) |
| Camera, location, media and other runtime permissions; avoiding them | [references/permissions.md](references/permissions.md) |
| Notifications, exact alarms, receivers, boot, WorkManager, FCM | [references/notifications-and-alarms.md](references/notifications-and-alarms.md) |
| Home screen widgets with Glance | [references/widgets.md](references/widgets.md) |
| Google sign-in, Firebase Auth, Firestore sync, account deletion, backend for paid APIs | [references/auth-sync-and-backend.md](references/auth-sync-and-backend.md) |
| Play Billing subscriptions, trials, server verification | [references/billing-and-subscriptions.md](references/billing-and-subscriptions.md) |
| Unit tests, Robolectric, Compose UI tests, instrumented tests, coroutine tests, lint | [references/testing.md](references/testing.md) |
| Startup, Baseline Profiles, jank, ANRs, memory leaks, Crashlytics | [references/performance-and-stability.md](references/performance-and-stability.md) |
| R8, resource shrinking, keep rules, signing, APK size | [references/release-build-and-r8.md](references/release-build-and-r8.md) |
| Emulator and phone over adb, UI driving, screenshots, logcat, app data, dates | [references/device-testing.md](references/device-testing.md) |
| GitHub Actions: tests, lint and build on every push; emulator tests in CI | [references/ci.md](references/ci.md) |
| Play Console, testing tracks, data safety, policies, store listing | [references/play-store-launch.md](references/play-store-launch.md) |
| Secrets, scanners, backup rules, Firestore rules, privacy texts | [references/security-and-privacy.md](references/security-and-privacy.md) |
| Windows and Git Bash pitfalls | [references/windows-git-bash.md](references/windows-git-bash.md) |
Scripts (run with `bash` or `python`; each prints `--help`):
| Script | What it does |
| --- | --- |
| `scripts/find_sdk.sh` | Finds the Android SDK, `adb`, the newest build-tools and a JDK; prints them as shell exports |
| `scripts/sign_with_debug_key.sh` | zipaligns and signs an unsigned release APK with the debug keystore so it installs over a debug build |
| `scripts/ui_drive.py` | Taps by visible text, types, scrolls until a text appears, presses keys, takes screenshots, scans logcat for crashes |
| `scripts/app_data.sh` | Backs up and restores a debuggable app's private data on an emulator |
| `scripts/test_report.py` | Totals JUnit XML results and Android lint findings |
## Hard rules
These protect the user's device, money and data. Follow them even when a request seems to imply otherwise. When the
skill is installed as a plugin, a hook enforces rules 1 and 2 for adb and Gradle commands; if it refuses a command,
do not look for a way around it: use the emulator, or tell the user what they would need to run themselves.
1. **Every adb command names a device**: `adb -s <serial> ...`. With a phone and an emulator connected, a bare `adb`
either fails or hits the wrong one.
2. **Never run destructive commands on a real phone**: no `uninstall`, `pm clear`, `rm` in app data, `settings put`,
factory reset or date changes. Update with `adb -s <serial> install -r app.apk`, which keeps the data. Ask before
every install on the user's phone. `connectedAndroidTest` uninstalls the app when it finishes: run it only with
`ANDROID_SERIAL` set to an emulator.
3. **Try every build on an emulator before the phone**: open it, walk the main screens, scan logcat (see
`device-testing.md`). A release build that does not crash can still log fatal errors from R8.
4. **The same signing key or no install.** `install -r` only works when the new APK has the installed one's signature.
Never "fix" a signature mismatch by uninstalling the user's app: that deletes their data.
5. **No API key for a paid service ships in the app.** Put paid calls (LLMs, SMS, email) behind a backend that checks
who is calling and how often (`auth-sync-and-backend.md`).
6. **Deploys, store uploads, publishing, purchases and paid API calls need the user's explicit yes**, each time.
7. **Never read, print or reuse a secret you find** (`.env`, `.dev.vars`, keystores, service-account JSON). Mask it if
you must mention it: first 4 and last 4 characters.
8. **Report what was verified and what was not.** "Tests pass" is not "works on the phone"; say which one you checked.
## Workflows
### A. Start a new app
1. Agree on the scope and write a short spec: screens, data, which features need Android APIs (notifications,
alarms, widgets, sign-in, billing), who the users are and in which countries (this drives the legal work later).
2. Fix the **package name** before registering it anywhere (Firebase, Play). It can never change on Play.
3. Create the project per `project-setup.md`: version catalog, `compileSdk`/`targetSdk` at the current level,
`minSdk` 26 is a reasonable floor, R8 on in release from day one, schemas exported for Room.
4. Lay out the layers per `architecture-and-data.md`: pure Kotlin rules in `domain/`, one `Repository`, a manual
container, ViewModels exposing `StateFlow`.
5. Build in **vertical slices** (one feature through data, rules, UI and tests), each ending green: unit tests, lint,
emulator walk-through. Commit per slice when the user asks.
6. Add risky platform pieces early (exact alarms under Doze, sign-in, billing) so surprises surface before the UI is
polished.
### B. Add or change a feature
1. Read the code that the feature touches and the relevant reference file.
2. Put the logic in plain Kotlin functions with unit tests (time and "today" passed in, never read inside rules).
3. Wire it to data and UI; update both language files if the app is localized.
4. Run unit tests and lint (`testing.md`), then walk the feature on an emulator in both themes and, if localized, in
each language. Check narrow screens (360 dp and 320 dp).
5. If it touches anything looked up by name or reflection, build the release variant and test it too
(`release-build-and-r8.md`).
6. If it adds a database column, table or synced field: migration + migration test; for Firestore, publish the new
security rules **before** shipping the app that writes the field.
### C. Verify a release build
When the skill is installed as a plugin, hand this to the `release-verifier` agent: it runs these steps on an
emulator and returns a short report, keeping Gradle and logcat output out of the conversation. Give it the project
directory, the package and the flows to walk. Read its report and look at the screenshots it lists before saying the
build works.
1. `./gradlew :app:assembleRelease`, then `bash scripts/sign_with_debug_key.sh <unsigned.apk> <out.apk>`.
2. Boot an emulator, `adb -s emulator-5554 install -r <out.apk>`.
3. Launch with `adb -s emulator-5554 shell am start -W -n <package>/<activity>` (prints `TotalTime` in ms).
4. Walk the main flows with `python scripts/ui_drive.py` (tap by text, screenshot each screen) and look at every
screenshot.
5. `python scripts/ui_drive.py --serial emulator-5554 crashes --package <package>` must report zero lines. Also read
the log for `ClassNotFoundException`, `NoSuchMethodError`, `Resources$NotFoundException` and serialization errors:
R8 problems often log without crashing.
6. Note the APK size and launch time; compare with the previous release.
### D. Install on the user's phone
1. Confirm the phone's serial (`adb devices -l`), the build type already installed, and that the signature matches.
2. Ask the user. Then `adb -s <phone-serial> install -r <apk>`. Never uninstall first.
3. If the user is away and wireless adb is not reachable, send the APK as a file instead. Chat upload limits are
often around 30 MiB; a debug APK with R8 turned on through a Gradle init script fits (`release-build-and-r8.md`).
4. Ask the user to confirm on the phone; say exactly what changed and what to look at.
### E. Prepare a Play Store release
Follow `play-store-launch.md` top to bottom. The usual blockers are not code: account type, closed testing with
testers for a set number of days on new personal accounts, the data safety form, a privacy policy URL, in-app and
web account deletion, and the signing fingerprints that Google sign-in and App Links need.
## Definition of done for any change
- Unit tests and lint pass; the counts are reported (e.g. "464 tests, 0 lint errors").
- The change was seen working on an emulator (screenshots looked at, logcat clean), or the report says it was not.
- Both languages and both themes updated if the app has them.
- Migrations and security rules shipped in the right order.
- The project's task list or notes say what was done, what was verified and what is left.