Skip to content

Repository files navigation

TinyAPK Lab

TinyAPK Lab

Real Android apps, hand-built APKs, kilobyte-scale.

Pure Java · Android SDK · No Gradle · No AndroidX · No Kotlin

English · Русский · Quick start · Projects · Build chain · Structure


Java 8 Android No Gradle APK size MIT License

Zero dependencies No Android Studio required 5 build steps 2 projects



Tetris screenshot Sandbox screenshot

Two playable games. Two APKs under 21 KB. Zero build-system dependency.

Built by a solo dev · assembled with five command-line tools


Note

No Gradle project inside. These apps are compiled and packaged by hand: aapt2 -> ecj -> d8/R8 -> zipalign -> apksigner. There is no build.gradle, no Android Studio project, and no AndroidX — just Java source, the platform SDK, and a handful of command-line tools.

TinyAPK Lab is a small, curated collection of Android apps written in plain Java against the raw Android SDK APIs. No Gradle, no Kotlin, no AndroidX, no game engine — just SurfaceView, Canvas, and a build chain assembled entirely from command-line tools. The point is to show how small, transparent, and portable a real, installable Android app can be.

Tip

Release APKs stay under 21 KB. An empty "Hello World" Android Studio project typically ships at 1.5–3 MB before a single line of logic is written. These apps are 70–150× smaller — and fully playable.

Pure Java, no bloat

SurfaceView + Canvas rendering, no game engine, no reflection-heavy frameworks — every line is readable.

Hand-built pipeline

aapt2 -> ecj -> d8/R8 -> zipalign -> apksigner — the same chain Android Studio hides from you, run by hand.

Kilobyte-scale APKs

Signed, installable release builds in the 16.8–20.9 KB range are committed straight into the repo.


Contents


Quick start

Option A — install a prebuilt APK

Every project already ships a signed release build in its build/ folder:

adb install "Tetris/build/LowBlocks-release.apk"
adb install "Sandbox/build/LowSand-release.apk"

Option B — build it yourself

No Gradle, no project to open in an IDE — just the platform build tools on your PATH:

aapt2 compile -o compiled/ res/**/*
aapt2 link -o app-unsigned.apk -I android.jar --manifest AndroidManifest.xml compiled/*.zip
ecj -d classes -classpath android.jar src/**/*.java
d8 --release --output . classes/**/*.class
zip -j app-unsigned.apk classes.dex
zipalign -f 4 app-unsigned.apk app-aligned.apk
apksigner sign --ks debug.keystore --out app-release.apk app-aligned.apk

Full, project-specific step-by-step notes live in manual-build/, including R8 shrinking guidance (EN / RU).


Projects

Project What it includes Build output
Tetris Swipe-based classic Tetris — 7 tetrominoes, ghost piece, wall kick, scoring, levels, next-piece preview. LowBlocks.apk — 16,811 B
LowBlocks-release.apk — 16,811 B
Sandbox Falling-sand simulation — powders, water, seeds, heat, steam, simple farming, cooking reactions. LowSand.apk — 20,907 B
LowSand-release.apk — 16,811 B
Build guides Manual build notes for aapt2 -> ecj -> d8/R8 -> zipalign -> apksigner, plus R8 shrinking guidance. Documentation

Screenshots

Tetris screenshot
Tetris
Minimal UI, ghost piece, scoring, level flow.
Sandbox screenshot
Sandbox
Particles, heat, farming, cooking.

Build chain

flowchart LR
    SRC["Java source<br/>+ resources"] --> AAPT["aapt2<br/>compile & link"]
    AAPT --> ECJ["ecj<br/>compile to .class"]
    ECJ --> D8["d8 / R8<br/>.class -> .dex"]
    D8 --> ZIP["zipalign<br/>4-byte alignment"]
    ZIP --> SIGN["apksigner<br/>sign"]
    SIGN --> APK["Signed APK<br/>16.8-20.9 KB"]
Loading

No Gradle daemon, no dependency resolution, no annotation processors — five tools, one direction, a fully inspectable output at every stage.


Tech stack

Java 8                 — language
Android SDK APIs       — platform, no support libraries
SurfaceView + Canvas   — rendering, no game engine
aapt2 -> ecj -> d8/R8 -> zipalign -> apksigner  — build chain

Deliberately not used: Gradle, Kotlin, AndroidX/Jetpack, external UI or game frameworks, third-party dependencies.


Repository structure

.
├── README.md                    # this file (English)
├── README.ru.md                 # Russian version
├── PROGUARD_README.md           # R8 / ProGuard shrinking guide (EN)
├── PROGUARD_README.ru.md        # R8 / ProGuard shrinking guide (RU)
├── LICENSE                      # MIT (EN)
├── LICENSE.ru.md                # MIT (RU)
├── THIRD_PARTY_TOOLS.md         # notice on Android SDK / build tools licenses (EN)
├── THIRD_PARTY_TOOLS.ru.md      # notice on Android SDK / build tools licenses (RU)
├── .github/
│   └── assets/
│       ├── banner.svg
│       ├── badges/
│       └── icons/
├── docs/
│   └── images/
│       ├── tetris-shot-v2.jpg
│       ├── sandbox_en.jpg
│       └── sandbox_ru.jpg
├── manual-build/                # manual build guides
│   ├── README.md
│   ├── SKILL.md
│   ├── proguard/SKILL.md
│   └── tetris/SKILL.md
├── tools/                        # platform build binaries & keystores
│   └── windows/
├── Tetris/
│   ├── README.md
│   ├── build.ps1
│   └── build/
└── Sandbox/
    ├── README.md
    ├── build.ps1
    └── build/

Why this exists

Most Android tutorials start with Gradle, AndroidX, and a few hundred megabytes of tooling before a single pixel is drawn. This repository goes the other way: how small, transparent, and dependency-free can a real, installable Android app get if you build it by hand, one tool at a time?

It works both as a reference for the manual aapt2 -> d8 -> apksigner pipeline and as a proof of concept that kilobyte-scale, Gradle-free Android apps are still entirely possible.


Documentation

Tetris project Gameplay, controls, and source layout
Sandbox project Particle rules, farming, and cooking mechanics
Manual build notes Step-by-step aapt2 -> ecj -> d8/R8 -> zipalign -> apksigner
R8 / ProGuard guide Shrinking, obfuscation, and size-reduction notes
Third-party tools notice Licensing notes for Android SDK / build tools

Principles

  • Minimal by mandate. If it needs Gradle, AndroidX, or a dependency manager, it doesn't belong here.
  • Transparent. No obfuscated build magic — every step of the pipeline is a plain command you can run yourself.
  • Portable. Builds from a terminal, with nothing more than the Android SDK command-line tools and a JDK.
  • Small by default. Every release APK is committed to the repo so you can see exactly what "kilobyte-scale" means.

License

Original code and documentation are released under the MIT License (EN / RU). A separate tooling notice (EN / RU) clarifies that these projects are built using the Android SDK and platform build tools, which remain under their own respective licenses.

TinyAPK Lab · real Android apps, kilobyte-scale

MIT License · See LICENSE for details

About

Build ultra-small Android APKs (12–50KB) without Gradle. Learn how Android works under the hood.

Topics

Resources

Stars

25 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages