Android stage 1: databases, games, the game viewer and the engine

androidApp/: Kotlin + Jetpack Compose over the Rust core (mobile-api, UniFFI).
- Databases: the desktop samples on the list from the first start, files added
  with the system picker and read in place, rename, remove with undo.
- Games: a paged list with a search by players, event, site and date.
- Game: the green board with Merida pieces, the notation as on the desktop
  (variations, comments, NAG), forks, paging games, hold-to-repeat steps,
  comment arrows and squares, the check glow, Latin/figurine/local notation.
- Engine: Stockfish 19 built from the pinned source (scripts/stockfish.sh) and
  run from nativeLibraryDir through the uci crate. Two builds: "full" with the
  network inside, "light" downloading it on request (resume, SHA-256 check).
  The time per position, lines, line preview on the board; the engine quits
  when the screen goes away.
- Settings and About with the licenses.

mobile-api: game search, UCI moves and comment marks for nodes, the Analyzer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubelroman 2026-10-22 01:40:37 +03:00
parent 0c912ac669
commit 68fcabd691
59 changed files with 5049 additions and 25 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View file

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

View file

@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View file

@ -0,0 +1,122 @@
<resources>
<string name="sample_classics">Классические партии</string>
<string name="sample_alekhine">Алехин</string>
<string name="empty_title">Здесь будут ваши базы</string>
<string name="empty_text">Добавьте файл PGN или архив .zip/.7z — с телефона или из облака.</string>
<string name="add_database">Добавить базу</string>
<string name="open_samples">Открыть примеры партий</string>
<string name="not_opened">ещё не открывалась · %1$s</string>
<plurals name="games_count">
<item quantity="one">%1$s партия</item>
<item quantity="few">%1$s партии</item>
<item quantity="many">%1$s партий</item>
<item quantity="other">%1$s партии</item>
</plurals>
<string name="games_with_format">%1$s · %2$s</string>
<string name="menu">Меню</string>
<string name="rename">Переименовать</string>
<string name="remove">Убрать из списка</string>
<string name="rename_hint">Название в списке. Файл не меняется.</string>
<string name="cancel">Отмена</string>
<string name="save">Сохранить</string>
<string name="removed">База убрана из списка</string>
<string name="undo">Вернуть</string>
<string name="back">Назад</string>
<string name="reading">Читаю…</string>
<string name="open_failed">Не удалось открыть базу</string>
<string name="no_access">Нет доступа к файлу. Добавьте его заново.</string>
<string name="search">Поиск</string>
<string name="search_hint">Игрок, турнир, год</string>
<string name="nothing_found">Ничего не найдено</string>
<string name="clear">Очистить</string>
<string name="game_of">%1$d из %2$d</string>
<string name="previous_game">Предыдущая партия</string>
<string name="next_game">Следующая партия</string>
<string name="flip">Перевернуть</string>
<string name="to_start">В начало</string>
<string name="move_back">Ход назад</string>
<string name="move_forward">Ход вперёд</string>
<string name="to_end">В конец</string>
<string name="next_moves">Дальше:</string>
<string name="board_hint">Это просмотр партии. Ходы листаются кнопками ◀ ▶ внизу.</string>
<string name="board_description">Доска, позиция после %1$s</string>
<string name="board_start">Доска, начальная позиция</string>
<string name="white_won">Победили белые</string>
<string name="black_won">Победили чёрные</string>
<string name="draw">Ничья</string>
<string name="game_failed">Не удалось прочитать партию</string>
<string name="engine">Движок</string>
<string name="thinking">Считаю…</string>
<string name="depth">гл. %1$d</string>
<string name="paused">пауза</string>
<string name="deeper">Глубже</string>
<string name="more_lines">Больше линий</string>
<string name="fewer_lines">Меньше линий</string>
<string name="engine_not_answering">Движок не отвечает</string>
<string name="engine_not_starting">Движок не запускается на этом телефоне</string>
<string name="restart">Перезапустить</string>
<string name="engine_line_preview">Линия движка · ход %1$d из %2$d</string>
<string name="close">Закрыть</string>
<string name="engine_sheet_title">Движок Stockfish</string>
<string name="engine_sheet_text">Оценивает позицию и показывает лучшие ходы. Работает без интернета — нужно один раз скачать.</string>
<string name="engine_size">Размер: %1$d МБ</string>
<string name="engine_metered">Сейчас нет Wi-Fi: загрузка пойдёт через мобильный интернет.</string>
<string name="not_now">Не сейчас</string>
<string name="download">Скачать</string>
<string name="downloaded_of">Скачано %1$d из %2$d МБ</string>
<string name="cancel_download">Отменить</string>
<string name="download_cancelled">Загрузка отменена</string>
<string name="engine_ready">Движок готов</string>
<string name="no_internet">Нет интернета. Подключитесь к сети и попробуйте ещё раз.</string>
<string name="interrupted">Загрузка прервалась. Скачанное сохранено.</string>
<string name="no_space">Не хватает места: нужно %1$d МБ.</string>
<string name="corrupt">Файл движка повреждён при загрузке. Скачайте его ещё раз.</string>
<string name="retry">Повторить</string>
<string name="resume">Продолжить</string>
<string name="download_again">Скачать снова</string>
<string name="ok">Понятно</string>
<string name="preparing_engine">Готовлю движок…</string>
<string name="settings">Настройки</string>
<string name="group_look">Внешний вид</string>
<string name="group_board">Доска</string>
<string name="group_engine">Движок</string>
<string name="theme">Тема</string>
<string name="theme_system">Как в системе</string>
<string name="theme_light">Светлая</string>
<string name="theme_dark">Тёмная</string>
<string name="notation">Запись ходов</string>
<string name="notation_latin">Латинские буквы (K Q R B N)</string>
<string name="notation_figurines">Фигурки</string>
<string name="notation_local">Русские буквы (Кр Ф Л С К)</string>
<string name="notation_hint">Только вид на экране. В PGN всегда K Q R B N.</string>
<string name="animation">Анимация фигур</string>
<string name="best_arrow">Стрелка лучшего хода</string>
<string name="vibration">Вибрация</string>
<string name="engine_built_in">Stockfish 19 · встроен</string>
<string name="engine_downloaded">Stockfish 19 · скачан</string>
<string name="engine_missing">Не скачан · Скачать (%1$d МБ)</string>
<string name="engine_downloading">Скачивается… %1$d из %2$d МБ</string>
<string name="engine_delete">Удалить движок (освободит %1$d МБ)</string>
<string name="engine_delete_question">Удалить движок? Его можно скачать снова.</string>
<string name="delete">Удалить</string>
<string name="lines">Линий</string>
<string name="time_per_position">Время на позицию</string>
<string name="seconds">%1$d с</string>
<string name="one_minute">1 мин</string>
<string name="no_limit">Без ограничения</string>
<string name="threads">Потоки</string>
<string name="memory">Память</string>
<string name="megabytes">%1$d МБ</string>
<string name="engine_battery">Движок расходует заряд. Он сам останавливается, когда гаснет экран.</string>
<string name="about">О программе</string>
<string name="build_full">Stockfish внутри</string>
<string name="build_light">Stockfish скачивается</string>
<string name="about_text">Просмотр шахматных баз: PGN, ChessBase, архивы. Файлы только читаются и никогда не меняются.</string>
<string name="licenses">Лицензии</string>
<string name="website">Сайт и исходный код</string>
</resources>

View file

@ -0,0 +1,121 @@
<resources>
<string name="app_name">ChessPenguin</string>
<string name="sample_classics">Classic games</string>
<string name="sample_alekhine">Alekhine</string>
<string name="empty_title">Your databases will be here</string>
<string name="empty_text">Add a PGN file or an archive .zip/.7z — from the phone or a cloud.</string>
<string name="add_database">Add database</string>
<string name="open_samples">Open sample games</string>
<string name="not_opened">not opened yet · %1$s</string>
<plurals name="games_count">
<item quantity="one">%1$s game</item>
<item quantity="other">%1$s games</item>
</plurals>
<string name="games_with_format">%1$s · %2$s</string>
<string name="menu">Menu</string>
<string name="rename">Rename</string>
<string name="remove">Remove from the list</string>
<string name="rename_hint">The name on the list. The file does not change.</string>
<string name="cancel">Cancel</string>
<string name="save">Save</string>
<string name="removed">Database removed from the list</string>
<string name="undo">Undo</string>
<string name="back">Back</string>
<string name="reading">Reading…</string>
<string name="open_failed">Could not open the database</string>
<string name="no_access">No access to the file. Add it again.</string>
<string name="search">Search</string>
<string name="search_hint">Player, event, year</string>
<string name="nothing_found">Nothing found</string>
<string name="clear">Clear</string>
<string name="game_of">%1$d of %2$d</string>
<string name="previous_game">Previous game</string>
<string name="next_game">Next game</string>
<string name="flip">Flip</string>
<string name="to_start">To the start</string>
<string name="move_back">Move back</string>
<string name="move_forward">Move forward</string>
<string name="to_end">To the end</string>
<string name="next_moves">Next:</string>
<string name="board_hint">This is a game viewer. Moves are stepped with the ◀ ▶ buttons below.</string>
<string name="board_description">Board, position after %1$s</string>
<string name="board_start">Board, starting position</string>
<string name="white_won">White won</string>
<string name="black_won">Black won</string>
<string name="draw">Draw</string>
<string name="game_failed">Could not read the game</string>
<string name="engine">Engine</string>
<string name="thinking">Thinking…</string>
<string name="depth">d. %1$d</string>
<string name="paused">paused</string>
<string name="deeper">Deeper</string>
<string name="more_lines">More lines</string>
<string name="fewer_lines">Fewer lines</string>
<string name="engine_not_answering">The engine is not answering</string>
<string name="engine_not_starting">The engine does not start on this phone</string>
<string name="restart">Restart</string>
<string name="engine_line_preview">Engine line · move %1$d of %2$d</string>
<string name="close">Close</string>
<string name="engine_sheet_title">Stockfish engine</string>
<string name="engine_sheet_text">Evaluates the position and shows the best moves. Works offline — it only has to be downloaded once.</string>
<string name="engine_size">Size: %1$d MB</string>
<string name="engine_metered">No Wi-Fi now: the download will go over mobile data.</string>
<string name="not_now">Not now</string>
<string name="download">Download</string>
<string name="downloaded_of">Downloaded %1$d of %2$d MB</string>
<string name="cancel_download">Cancel</string>
<string name="download_cancelled">Download cancelled</string>
<string name="engine_ready">The engine is ready</string>
<string name="no_internet">No internet. Connect to a network and try again.</string>
<string name="interrupted">The download was interrupted. What came is kept.</string>
<string name="no_space">Not enough space: %1$d MB needed.</string>
<string name="corrupt">The engine file was damaged in the download. Download it again.</string>
<string name="retry">Try again</string>
<string name="resume">Continue</string>
<string name="download_again">Download again</string>
<string name="ok">OK</string>
<string name="preparing_engine">Preparing the engine…</string>
<string name="settings">Settings</string>
<string name="group_look">Look</string>
<string name="group_board">Board</string>
<string name="group_engine">Engine</string>
<string name="theme">Theme</string>
<string name="theme_system">As in the system</string>
<string name="theme_light">Light</string>
<string name="theme_dark">Dark</string>
<string name="notation">Move notation</string>
<string name="notation_latin">Latin letters (K Q R B N)</string>
<string name="notation_figurines">Figurines</string>
<string name="notation_local">Letters of the language</string>
<string name="notation_hint">Only how moves look on the screen. PGN always keeps K Q R B N.</string>
<string name="animation">Piece animation</string>
<string name="best_arrow">Best-move arrow</string>
<string name="vibration">Vibration</string>
<string name="engine_built_in">Stockfish 19 · built in</string>
<string name="engine_downloaded">Stockfish 19 · downloaded</string>
<string name="engine_missing">Not downloaded · Download (%1$d MB)</string>
<string name="engine_downloading">Downloading… %1$d of %2$d MB</string>
<string name="engine_delete">Delete the engine (frees %1$d MB)</string>
<string name="engine_delete_question">Delete the engine? It can be downloaded again.</string>
<string name="delete">Delete</string>
<string name="lines">Lines</string>
<string name="time_per_position">Time per position</string>
<string name="seconds">%1$d s</string>
<string name="one_minute">1 min</string>
<string name="no_limit">No limit</string>
<string name="threads">Threads</string>
<string name="memory">Memory</string>
<string name="megabytes">%1$d MB</string>
<string name="engine_battery">The engine uses the battery. It stops by itself when the screen goes dark.</string>
<string name="about">About</string>
<string name="build_full">Stockfish built in</string>
<string name="build_light">Stockfish downloaded in the app</string>
<string name="about_text">A viewer of chess databases: PGN, ChessBase, archives. Files are only read, never changed.</string>
<string name="licenses">Licenses</string>
<string name="website">Website and source code</string>
</resources>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.ChessPenguin" parent="android:Theme.Material.Light.NoActionBar" />
</resources>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample backup rules file; uncomment and customize as necessary.
See https://developer.android.com/guide/topics/data/autobackup
for details.
Note: This file is ignored for devices older than API 31
See https://developer.android.com/about/versions/12/backup-restore
-->
<full-backup-content>
<!--
<include domain="sharedpref" path="."/>
<exclude domain="sharedpref" path="device.xml"/>
-->
</full-backup-content>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?><!--
Sample data extraction rules file; uncomment and customize as necessary.
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
for details.
-->
<data-extraction-rules>
<cloud-backup>
<!-- TODO: Use <include> and <exclude> to control what is backed up.
<include .../>
<exclude .../>
-->
</cloud-backup>
<!--
<device-transfer>
<include .../>
<exclude .../>
</device-transfer>
-->
</data-extraction-rules>