Skip to content

gubaiovo/riddle-android

Repository files navigation

riddle-android

Android tablet port of MaximeRivest/riddle: write on the page with a pressure-sensitive stylus, wait for the diary to drink the ink, and watch an AI answer write itself back.

This is a native Android implementation rather than a wrapper around the original Rust executable. The reMarkable-only hardware layer has been replaced while the diary interaction, oracle protocol, and local memory model have been retained.

What was migrated

Original riddle Android implementation
Raw Linux evdev pen samples Android MotionEvent, stylus pressure, batched samples, TOOL_TYPE_ERASER, and optional one-finger writing
RGB565/quill framebuffers Hardware-accelerated Android View, Canvas, and an off-screen page bitmap
2.8-second idle commit Configurable 0.8–10 second stylus-rest timer; default 2.8 seconds
Cropped grayscale page PNG Cropped/downscaled PNG generated in memory; no temporary page file
OpenAI-compatible SSE oracle Native HttpURLConnection client for /chat/completions, inline vision image, streaming sentence parser, and token-field retry
oracle.env On-tablet settings screen; API key encrypted with Android Keystore
Dancing Script stroke replay Bundled Dancing Script face with progressive handwritten reply animation
index.tsv plus stroke files App-private JSON index and per-page stroke files, capped at 400 memories
⟦show:N⟧ / protocol Same memory-conjuring and transcription protocol
Large ? guide Same pen-only guide gesture, adapted to tablet dimensions
Five-finger/root takeover Android immersive full-screen mode; normal system navigation remains available

The Android version deliberately does not attempt direct e-ink waveform control. Refresh behavior is owned by the tablet firmware, so it works on conventional LCD/OLED Android tablets and Android-based e-ink tablets without root access.

Requirements

  • Android 8.0 or newer (API 26+)
  • Portrait tablet layout
  • An Android-compatible pressure-sensitive stylus, or the optional one-finger writing mode
  • Internet access
  • An API key for an OpenAI-compatible, vision-capable /chat/completions endpoint

First run

  1. Install the APK produced by GitHub Actions.
  2. Enter the API key, base URL, and a vision-capable model in the settings screen. For Alibaba Cloud Model Studio, qwen3.6-flash is supported. Use the endpoint from the same region as the API key; a workspace-specific endpoint is recommended. The settings screen can run an image-capable connection test and displays the HTTP status, elapsed time, request ID, and raw response without exposing the API key.
  3. Write with the stylus and lift it. On phones without a stylus, enable Allow writing with one finger in settings. After the configured pause, the page is committed.
  4. Tap the faint three-dot mark in the top-right corner with a finger to reopen settings.
  5. Draw a large ? with the stylus to show the in-app guide.

The API key is encrypted with an AES-GCM key held by Android Keystore. Completed page memories are stored in the app's private internal storage. Each committed handwriting crop and the configured recent-memory context are sent only to the configured oracle endpoint. There is no telemetry.

One-finger writing is disabled by default so stylus users retain palm rejection. When enabled, finger strokes use a fixed width and any multi-touch gesture cancels the current finger stroke.

GitHub Actions build

The canonical build runs entirely on GitHub Actions. No local build is required.

  • Push to main, open a pull request, or run Android build manually from the Actions tab.
  • The workflow validates the Gradle wrapper, runs JVM unit tests and Android lint, and creates an installable debug APK.
  • Download riddle-android-debug-<run number> from the workflow run's Artifacts section.

Build stack:

  • Android Gradle Plugin 9.3.0
  • Gradle 9.5.0, with the official distribution SHA-256 pinned
  • Temurin JDK 17
  • compile/target SDK 36

The workflow installs Android Platform 36 and Build Tools 36.0.0 explicitly on the GitHub runner before invoking Gradle.

No API key or other secret is required by the build. The key is entered only on the tablet.

Project layout

  • app/src/main/java/.../ui/DiaryView.java — stylus handling and diary state machine
  • app/src/main/java/.../ai/OracleClient.java — OpenAI-compatible SSE client
  • app/src/main/java/.../ai/StreamParser.java — sentence, memory directive, and transcript parser
  • app/src/main/java/.../data/MemoryStore.java — private on-device page memory
  • app/src/main/java/.../data/SettingsStore.java — settings and Keystore-backed API-key encryption
  • .github/workflows/android.yml — the complete CI build
  • docs/MIGRATION.md — source-by-source migration decisions and intentional differences

License

MIT, matching the upstream project. Dancing Script is distributed under the SIL Open Font License; see third_party/dancing-script/OFL.txt.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages