GitHub - alramlechner/Chessomnia: A chess board for two players sharing one tablet. Not a chess computer: no engine, no ads, no tracking, works offline. · GitHub
Skip to content

About

A chess board for two players sharing one tablet. Not a chess computer: no engine, no ads, no tracking, works offline.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Chessomnia app icon: a queen and a king side by side

Chessomnia

A chess board for the table you are sitting at.

Chessomnia replaces the physical board when you don't have one to hand. Two players sit opposite each other, the tablet — or phone — lies flat on the table between them, and they play the way they would on wood and felt, except that the app knows the rules.

Free, ad-free, registration-free, and it tracks nothing. Those four are the point. Free means free — no trial, no lite version, nothing to unlock, no in-app purchase. There is no account and no sign-up: you install it and you play. And the last one is not a promise but a property — the release build holds no Android permission that grants it anything — INTERNET above all — so it cannot send anything anywhere.

There is also no evaluation bar and no move suggestion, and there never will be. That is a separate decision, and a deliberate one: the app shows you the rules, not an opinion about who is winning.

When nobody else is around, the board plays: Play against the device, four strengths, your choice of colour. The top strength is deliberately a good club amateur rather than as strong as it could be — an opponent nobody can beat is not a feature. The bottom one is meant for a child of nine: it keeps its own position together and walks past most of what you leave hanging, instead of quietly collecting every piece you overlook. The engine is written for this app, runs entirely on the device, and adds no permission and no dependency; see ARCHITECTURE.md.

License Platform

The king selected, its legal moves marked, castling highlighted separately An en passant capture offered on the board

Tap a piece and every legal move is marked — with castling and en passant called out separately, because those are the ones beginners miss. More in store/screenshots.


What it does

  • Complete FIDE rules — castling, en passant, promotion, checkmate, stalemate, the fifty-move rule, threefold repetition and dead positions.
  • Learning aid — tap a piece and every legal move for it is marked, including the special moves beginners overlook.
  • An optional opponent — four strengths, from one a nine-year-old can beat to a good club amateur, your choice of colour, entirely on the device. Taking a move back against it undoes both halfmoves, so it is your turn again.
  • Two-sided layout — clock, status line and buttons exist twice, once at each table edge. The upper player's panel and pieces are drawn rotated 180°, so both players read their own material the right way up.
  • A clock that informs rather than judges — it counts upward, measuring how long each player has thought in total. It never runs out and never ends a game.
  • Take back a move — a takeback restores the position and the clock in one step. There is deliberately no "resign" and no "offer a draw": nothing is recorded anywhere, so how a game ends makes no difference. Leave to the menu and start a new one.
  • Survives everything — the running game outlives a trip to the menu, a rotation and an app restart.

What it deliberately does not do

No evaluation bar or move hints. No move list or SAN notation. No PGN export. No online play. No account, no advertising, no analytics.

Why you might want it

  • Free. Not a trial, not a lite version. Nothing to unlock, no in-app purchases.
  • Ad-free. No advertising SDK, no analytics, no crash reporting.
  • Registration-free. No account, no sign-up, no email address. Install and play.
  • No tracking — as a property, not a promise. The release build holds no Android permission that grants it anything, INTERNET above all, so it is incapable of sending anything anywhere. The source manifest declares none at all (AndroidManifest.xml); the merged one carries a single line, …DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION, which AndroidX declares for the app about itself so it can register a receiver as not-exported.
  • Not an analysis tool. No evaluation bar and no best-move hints. The opponent plays its move and says nothing about yours.

Privacy

The short version: the app collects nothing and sends nothing. Everything it stores — your settings and the game in progress — stays in the app's own private storage on the device.

The one thing that can leave the device is a bug report, and only when you explicitly share it: "Report a problem" builds a plain-text description of the position and hands it to Android's share sheet. You choose where it goes, and you see the text first.

Full statement: PRIVACY.md.

Design decisions worth knowing

These follow from one premise — the device lies flat on the table between two people. A tablet suits that best; on a phone the board is simply smaller:

  • The board never rotates automatically. One player sees it upside down, exactly as at a real board. That is the point, not a defect. "Turn the board" rotates it 180° so nobody has to pick the device up.
  • Dialogs turn to face whoever asked. A promotion dialog in a fixed orientation would be unreadable for one of the two players every time. Every prompt therefore carries the player who triggered it.
  • The end of the game does not cover the board. Result and reason appear in the two panels at the table edges. When you have just been mated you want to see why — the highlighted king and the marked last move are the answer, and nothing may hide them.
  • Captured pieces sit on the side of the player who took them, with the net material advantage. A plain sum would be misleading: trading queens would read "+9".

More, including the reasoning behind the rules engine, in ARCHITECTURE.md.

How correctness is ensured

A hand-written test only checks a hand-written engine against its author's own assumptions, so there are three independent layers:

  1. Perft against the six published standard positions. Depth 3 on every build, depth 4–5 behind a flag (12.4 million nodes, exact). This exhausts move generation.
  2. Cross-check against python-chess — 4,576 positions with their full legal-move list and game status, generated by a foreign implementation. Deliberately dense around endings: 756 checkmates, 420 stalemates, 400 dead positions, 29 fifty-move draws. Random games alone almost never reach mate, and without mates the corpus would not answer the question that matters.
  3. Invariants over random games — after every halfmove the tracked king square is checked against a board scan and isInCheck against a brute-force test. This targets the one bug that would silently turn a checkmate into a stalemate.

A by-product of introducing layer 2: of ten hand-written "mate positions" in the test suite, five were not mates. The engine had been right every time. Hand-written test data is the least reliable source in chess.

Building

Requires JDK 17 and the Android SDK.

cd android-app
./gradlew assembleDebug        # debug APK
./gradlew test                 # 95 unit tests, about a second
./gradlew test -DperftDeep=1   # plus the deep perft runs (12.4M nodes)

The release build is minified and shrunk. To sign it, copy android-app/keystore.properties.example to keystore.properties and fill it in; without that file the release build is simply left unsigned, which is what a fork or a CI check wants.

./gradlew bundleRelease        # Android App Bundle

Cutting an actual release — versioning, the checks that catch a build which succeeds but is wrong, and the Play Console steps — is written up in RELEASING.md.

Language / UI Kotlin 2.2, Jetpack Compose, Material 3
AGP / Gradle 8.13.2 / 8.14.5
SDK minSdk 30 (Android 11), compileSdk/targetSdk 36
Dependencies Compose, Navigation, Lifecycle ViewModel, kotlinx.serialization. No Room, no WorkManager, no Google Play Services

Project layout

android-app/app/src/main/java/name/lechners/chessomnia/
├── rules/       Rule engine. Pure Kotlin, no Android imports, fully unit-testable
├── engine/      The optional opponent. Pure Kotlin too, and built on rules/ unchanged
├── game/        A game in progress: move history, takeback, clock
├── data/        Settings, persistence, bug report
└── ui/          Compose: board, panels, overlays, screens
tools/           Generators for the icon, the wordmark, the piece drawables and the test corpus
licenses/        Full licence texts of everything third-party

Licence

The code is Apache-2.0 — see LICENSE and NOTICE.

Third-party content, all of it reproduced in full under licenses/ and shown in the app under Settings → About → Show licenses:

What Origin Licence
Chess pieces Staunton set by Colin M. L. Burnett ("Cburnett"), Wikimedia Commons BSD 3-Clause¹
Wordmark Set in Montserrat by Julieta Ulanovsky et al. SIL OFL 1.1²
App icon and mark Original work — king and queen, generated by tools/generate_app_icon.py Apache-2.0
Libraries AndroidX, Jetpack Compose, Kotlin, kotlinx.serialization Apache-2.0

¹ Cburnett offers the set under GFDL, CC BY-SA 3.0, BSD 3-Clause and GPL 2+ with an explicit free choice. Chessomnia elects BSD 3-Clause: attribution stays required, but share-alike does not apply.

² Only the letter outlines are used; the font file itself is not redistributed. Under the OFL, a document set with a font is not itself subject to the OFL.

Contributing

Bug reports are especially welcome — the in-app Report a problem button produces exactly the text needed to reproduce a position. See CONTRIBUTING.md.

Please note the scope: pull requests that add an evaluation display, move suggestions or online play will be declined, however well written — as will ones that make the opponent stronger. That boundary is the product.

Impressum

chessomnia@lechners.name — the address the in-app Report a problem button suggests, and the one to write to for anything else concerning this app.

About

A chess board for two players sharing one tablet. Not a chess computer: no engine, no ads, no tracking, works offline.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages