hex/android
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel f7c9075c11
android typing benchmark: Replay passes finish()'s commit argument again (#2721)
Smart quotes (#2644) gave TypingWord.finish a fourth parameter, commit, which spells a
replacement as it goes in. Kotlin's default doesn't reach Java, so Replay.java's three-argument
call stopped compiling and quality-gate.py has not run on dev since. Replay now passes the
identity, which is what the keyboard passes with Labs › Smart quotes off (its default): smartWord
returns the word unchanged.

Verified on dev 75b8a677: android/benchmark/typing/quality-gate.py all builds and runs (22 s);
English, Spanish and French pass, and German, Italian and Bokmål fail as they have since the
gate landed (#2374): German 0/52 unambiguous ß forms restored, Italian 76.7% of unambiguous
accents (85% needed), Bokmål 0.59% of correct words changed (0.5% allowed). The same patch on
dev c7eecba6 gave the identical report for #2719.
2026-11-24 11:00:14 -05:00
..
app Android keyboard: Keyboard vibration silences Hex only where the phone has that switch (#2718) 2026-11-24 10:41:08 -05:00
benchmark android typing benchmark: Replay passes finish()'s commit argument again (#2721) 2026-11-24 11:00:14 -05:00
gradle/wrapper Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00
play Android: Send feedback form that posts to Bellhop (#2582) 2026-11-23 15:51:14 -05:00
scripts Android Hex Preview: the update card says to tap the download again after allowing the browser (#2715) 2026-11-24 10:26:14 -05:00
.gitignore Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00
build.gradle.kts Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00
gradle.properties Android: Send feedback form that posts to Bellhop (#2582) 2026-11-23 15:51:14 -05:00
gradlew Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00
gradlew.bat Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00
README.md Android Hex Preview: the update card says to tap the download again after allowing the browser (#2715) 2026-11-24 10:26:14 -05:00
settings.gradle.kts Hex for Android: on-device dictation keyboard (#2074) 2026-11-20 17:27:17 +00:00

Hex for Android

Hold the Hex key, speak and release to insert text in the current app. A tap starts hands-free dictation; ✓ finishes and ✕ discards. The Hex key sits at the strip’s trailing end, where Gboard has its mic; while dictating it becomes ✓ and the live dot waveform grows out of it, above the keys. While Hex transcribes, a spinner takes the checkmark’s place and ✕ still cancels, which also stops the transcription itself. A recording stops at 1 minute and says so (“Stopped at 1 minute”); its text is still inserted. While a dictation opens, listens or transcribes, the keyboard’s and Home’s windows hold Android’s FLAG_KEEP_SCREEN_ON (no permission), so the display timing out can’t hide the IME and cancel the recording; the screen sleeps normally again once Hex is idle. Dictation’s notes show in the strip even while Hex Preview’s update line is waiting, which returns afterwards. The keys are Gboard’s size and place on a Pixel (measured on an emulator), with ?123, comma, space, period and enter in the bottom row (the second symbols page puts < and > there, as Gboard does); the system’s own switcher in the navigation bar, or Hex menu › Next keyboard, changes keyboards.

Speech model and privacy

Whisper small Q5_1 is the default; multilingual tiny Q5_1 is bundled and works from first launch in airplane mode. The Android benchmark compares tiny, base, small, Parakeet and Android’s strictly on-device provider on the same 40 clips. Hex’s small configuration reduced WER from 17.54% to 5.26% and used 344 MiB peak native RSS on short clips. Norwegian remains the weakest language.

Welcome explains that the internet is used only to fetch the 190 MB speech model and, when you tap Send, to send feedback. Get started begins a fixed HTTPS download; setup shows progress and lets you continue with tiny. The partial file is kept: when Android closes the connection because Hex went to the background, or Hex is closed or the phone restarts, the download continues with an HTTP range request the next time a Hex screen is open. A real failure (no connection, server error, full storage) says so and offers Retry, which also continues. ModelStore verifies the exact byte count and SHA-256 before atomically installing it in private, non-backed-up storage. The keyboard never makes a network request. Missing or unusable small weights fall back to tiny. Voice, words and translations stay on the device; Hex has no telemetry, transcript history or network speech service. The app’s only other request is Send feedback, made when you tap Send.

Keyboard and styles

Automatic follows a keyboard layout chosen in Keyboard › Keyboard layout, else the first supported Android system language, else English. Hold the language-labelled space bar to switch immediately between Automatic, English, Español, Deutsch, Norsk (Bokmål), Français, Italiano, Nederlands, Português, Polski and Русский. Português is one entry for Brazil and Portugal (Whisper has one pt). It, Nederlands, Polski and Русский keep the English layout (Polish letters are held on their base keys; there are no Cyrillic keys yet), so they type with English’s keys and accents and none of English’s suggestions, next words or autocorrections — your own dictionary words still complete and your text shortcuts still apply — and have no cleanup or list rules; pin a layout in Keyboard › Keyboard layout to type with that layout’s words. Português has spoken punctuation, the other three don’t. Slide on the Hex key or tap Hex menu to change the spoken language or style:

  • Polished (default): trims standalone hesitation sounds, fixes spacing/capitals and closes sentences.
  • Casual: lowercase texting, without the period at the end of a single statement.
  • Notes: “bullet point,” “next bullet,” “new line” and “new paragraph” become list items and breaks.
  • Verbatim: keeps the recognizer’s words and punctuation; no cleanup is applied.

Clean up what I say is off by default. The deterministic rules remove hesitations and resolve explicit self-corrections against nearby words of the same kind. Spanish, German and Norwegian use the iOS word lists and pause boundaries; English uses explicit markers, not iOS’s learned tagger or an LLM. Ambiguous repairs stay as spoken. Ordinary negation and language-specific words such as German “eh” and Norwegian “er” stay intact.

Translate what I say is also off by default. With Español and translation enabled, Next dictation offers Paste in English or Paste as spoken. The choice is captured when recording begins; after a one-off spoken-language insertion, the next dictation returns to English. Translation is multilingual Whisper’s native speech-to-English task, not a second text model or online SDK. The tested Spanish WAV inserted both “El café todavía está caliente.” and “The coffee is still hot.” offline.

Typing assistance

All four layouts have a bundled, memory-mapped HXTM v3 word and word-pair model. English and Spanish keep the original iOS Google Books files. German uses Google Books; Bokmål uses the National Library of Norway’s book counts filtered by Norsk ordbank. Start typing to see ranked suggestions; tap one to insert it. A space brings up next-word predictions. Passwords and email addresses use literal typing; a URL or web search field, as a browser’s address bar is, keeps suggestions and swipe typing but never autocorrects, shows no highlighted autocorrection and changes nothing typed there (no double-space period, text replacement or tap correction); a picked suggestion goes in with a space, as Gboard’s does there, and a following mark such as . or / takes that space (“github.”, “github/”), while a swiped word gets the usual space before it and none after; a field that asks for no suggestions, completions or filtering, as a search box does, keeps suggestions, next words, emoji suggestions, swipe typing, text replacements and double-space period but does not autocorrect on space or punctuation: no autocorrection is highlighted in the strip, though a text replacement still shows and applies; a field that asks not to be learned from, as an incognito tab does, keeps every suggestion, autocorrection, swipe and double-space period, and remembers nothing typed there: an undone autocorrection is not counted, and a picked emoji does not join the picker’s recents. A field that keeps its own text, as a terminal’s TYPE_NULL editor does, gives Hex nothing to read back or edit: suggestions, autocorrection, swipes and smart quotes are off there, Delete and a held Delete send one delete key press each (a key press per press, never a surrounding-text delete), Delete’s slide is off, the space bar’s cursor slide steps with arrow keys instead of setting a selection, and Enter sends an Enter key when the editor has no action. Read from the source and the field’s unit test; not tried on a device.

Português, Nederlands, Polski and Русский have no typing model of their own: while one of them is dictated and no layout is pinned, English’s word list only gives the keys their geometry. The strip offers what you typed and your own dictionary words as completions; there are no next words, no autocorrection or replacement on space and punctuation, and no tap correction, swipe typing or English emoji keywords. Double-space for a period, your personal-dictionary text shortcuts, capitals and the literal chip keep working. Pin a layout in Keyboard › Keyboard layout to type with its model.

Keyboard › Keyboard layout follows dictation by default; an explicit layout can differ from the space bar’s spoken language. Spanish has a dedicated ñ, and holds ¿ and ¡ on ? and !. German is QWERTZ with ü, ö and ä; hold s for ß. Bokmål has å, ø and æ.

Keyboard › Suggest swear words is off by default on every layout. Slurs on the curated list are never offered, even when swear words are enabled. The filter applies to completions, next words, autocorrect and both halves of a missed-space correction. Typing a listed word in full keeps your exact spelling; its literal chip accepts what you typed. The filter never changes the HXTM models.

On space, the Kotlin decoder compares each tap with the measured key centres and combines those distances with the previous word’s probability. It can recover a missing space. A known spelling requires a higher confidence margin than a nonword. Immediately press Delete to restore exactly what you typed, without the space. Undo the same replacement twice and Hex keeps that spelling in later sessions. Only rejection counts keyed by hashes are saved locally; there is no typing journal. In a field that asks not to be learned from (an incognito tab), undo still restores exactly what you typed, but that rejection is not counted; a picked emoji is not remembered either.

Keyboard › Swipe typing is on by default, as on iPhone Hex and Gboard (Gboard calls it glide typing). Slide from a letter through a word's letters and lift: a trail follows the finger and the strip shows the word so far. Lifting types the best reading, after a space unless the text before ends in one, a line break or opening punctuation, with a capital from shift or a sentence's start; names and German nouns take theirs from the capitals list. The strip then offers the next three readings; tapping one puts it in the word's place. A letter, digit or opening mark tapped next goes in after a space; a comma, period or other closing mark goes against the word. Delete right after takes the whole word back as Gboard's does: the space before it stays, the strip offers the word again, and the same swipe there types its next reading instead. Space never autocorrects a swiped word. A drag that comes back to the key it started on types that key; a hold for accents, a slide from shift or ?123, the space bar's cursor and Delete's slide work as before, and a second finger going down finishes the swipe first. Swipes work in all six layouts, in fields where Hex reads words (not passwords, addresses or URLs), except while a dictation language without a typing model is dictated and no layout is pinned (Português, Nederlands, Polski or Русский): English’s words are only standing in for the keys there, so they never guess ahead. ß is read through s, and French œ and æ through o and e and through a and e.

SwipeDecoder is iPhone Hex's decoder in Kotlin with the same parameters. A path is resampled in key pitches, and the words starting and ending near its ends are read in place from the same HXTM model. Each is scored on location, shape, where the finger turned and paused, and the word before. On the iPhone benchmark's method and the held-out sentences (swipe-bench.py), the Android and iPhone decoders give the same four readings for every one of 12,514 English swipes. The first word is right for 96.9% of English swipes and 94.3% of Spanish, 95.9% German, 96.4% Bokmål, 95.2% French and 96.0% Italian; the word is typed or in the strip 99.2–99.6% of the time. A swipe takes 1.0–1.4 ms at the median and under 5 ms at p99 on the API 36 emulator. Swipe results and how to run them

Keyboard settings and Hex menu → Typing feedback control key pop-ups and key haptics independently. Both default on. Each key press is one light tick that Hex plays on the vibrator itself, not Android’s keyboard effect, which some phones (Samsung’s One UI) keep for their own keyboard. The tick is touch feedback, so the phone’s touch vibration setting applies (Pixel: Sound & vibration › Vibration & haptics › Touch feedback; Samsung: Sounds and vibration › System vibration › Touch interactions), and Hex also follows the system’s Keyboard vibration switch (Android 15 and later). Hold a letter, slide to an accent, and release. Turning off pop-ups leaves the deliberate accent picker available.

English/Spanish typing benchmark, model sources and licences

Settings

After setup, Home shows Ready or Finish setup, a Dictate bar and four destinations, following the iOS navigation in #2054. Tap Dictate, speak, then Finish dictation: Hex displays the local result on Home. Dictation controls style, language, translation, cleanup and the offline speech model. Keyboard has layout, autocorrect, swipe typing, key pop-ups, haptics and a practice field. Privacy explains storage and links the model credits. Labs has an Output group with Signature (off): each keyboard dictation ends with “Sent from Hex” on its own line. The line is editable, one line of up to 200 characters, and an empty line adds nothing. The next dictation starts on a new line below the signature, and a signed dictation never continues the signature line. Home’s preview and Copy stay unsigned, and Hex’s own fields are never signed. Labs also has a Keyboard group with Symbols on letter keys (off): hold a letter from QWERTY’s home or bottom row, such as m, to type / first, with the letter’s accents after it. Symbols follow the letter, so AZERTY q/w and QWERTZ y get none where their layouts draw those letters on rows 2 and 3. Row 1 keeps its digit while it shows one: with Number row off it hints and holds the digit first; with it on, the top row’s letters show Gboard’s symbols in its place and hold them first (q for %, p for }, r for = as j holds it), and a letter that already has a home- or bottom-row symbol keeps that one (@ on AZERTY a, _ on AZERTY z and QWERTZ z). The top row’s symbols stay on row 1. Off, the keyboard is unchanged. The same group has Number row (off): while it is on, every letter layout draws 1 2 3 4 5 6 7 8 9 0 in a row above the letters, so a digit types without switching to ?123. The digits type like normal keys, with key pop-ups, haptics and their held symbols, and shift leaves them alone. With the number row on, the letter keys’ corner digits and digit-first holds are gone, and the Symbols on letter keys hints and holds still work, row 1’s first ten letters showing a symbol instead of the digit (Gboard’s, such as q for % and p for }, or the letter’s own home- or bottom-row symbol where it has one, like AZERTY a for @). The keyboard is one row taller and the Hex menu keeps its keys but matches that height; switching between the letters and ?123, the symbols pages or a number pad changes the height by a row while it is on. With the toggles off the keys are exactly as before. The same group has Local currency (off): the ?123 page shows your region’s currency in $’s place — £ in Britain, € in the eurozone, ¥ in Japan and China, and ₹, ₱, ₩, ₽ or ₴ where those are used. Only the first system language with a country is read, and the currency’s code decides the symbol, so it never follows the phone’s wording; an unknown region, a first language whose region isn’t a country (such as Latin American Spanish, es-419), a currency Hex has no single symbol for, and the United States keep $. Holding the key types $ first, then the key’s held symbols without a second copy of the local one. The second symbols page’s money row is £ ¢ € ¥: a local £, € or ¥ gives its slot to $, and any other local currency takes only ¥’s slot, so £, ¢ and € stay drawn and no page shows a symbol twice. Off, both pages draw Gboard’s rows. That group also has Emoji suggestions (off): on the English keyboard, while an English word that names an emoji is being typed (never while English’s list only stands in for a dictation language without a layout), the strip’s last slot offers it beside the word suggestions — “smile” gives 😊, “joy” or “haha” gives 😂, “heart” gives ❤️. It always takes that last slot, even when it is the only suggestion. Matching is case-insensitive and whole-word; continuing to type keeps the word, and nothing matching leaves the strip unchanged. Tapping the emoji replaces the word and commits it with the same space rules as a word suggestion. The word list uses the same 0.85 strong cut-off as iPhone Hex, plus a reviewed “joy” → 😂 and a reviewed exclusion list (number words that name clock faces, and ordinary words that name an emoji’s object in another sense), generated from the iOS keyboard’s emoji index (Unicode emoji-test 18.0 and CLDR 49, plus Hex’s chat words) by build-emoji-suggestions.py. It is a 10 KB asset (828 words), read lazily only while the toggle is on; the loader keeps only emoji the device’s Paint.hasGlyph can draw (minSdk 31 draws up to Emoji 13.1), so the strip never shows tofu. The same group has Keyboard tools (off): while the strip has nothing else to show (no suggestions, Undo dictation, notice or dictation), its Hold Hex to talk hint becomes up to four buttons — emoji, paste, Hex’s Keyboard settings and undo of the last autocorrection — without making the keyboard taller. The emoji button appears only on the letters page, where the keys’ own emoji key is; a symbol page or a number, phone or date pad has none. Paste uses the editor’s own paste and appears only while the clipboard has something, and password and PIN fields show none. Undo appears only while the last autocorrection is still right before the cursor, and only when no next-word suggestions fill the strip; the Delete right after an autocorrection still undoes it when they do. Settings reopens Hex on its Keyboard page, replacing whatever Hex screen was open. The same group has Smart quotes (off): in a plain-text field (not a password, email or URL field, or a TYPE_NULL field such as a terminal), the ' and " keys type ’ ‘ “ ”. An opening quote — ‘ or “ — goes in at the start, after whitespace, or after an opening bracket or quote; the closing quote or apostrophe — ’ or ” — goes in after anything else. A word picked from the strip, autocorrected or swiped goes in with ’ for its apostrophe (“don’t”), your own text replacements get ’ for each straight apostrophe they contain (a " in one stays straight), and a dictation’s straight quotes are placed by the same rules, after its spacing is decided, in the same plain-text fields as the keys. The strip shows the ’ a suggestion will insert. A quote key’s held alternates still type exactly what they show. With the toggle off, keys, picks and dictation insert the straight characters they always did, and existing ’ and ” are treated like ' and " for word boundaries, spacing and lookups. The same group has Password manager suggestions (off): while Android’s autofill service — Bitwarden, 1Password or Google Password Manager, which must itself support Android 11’s inline suggestions — offers logins, one-time codes or cards for the focused field, its own chips take the word suggestions’ place in the strip: up to six, in the service’s order, the pinned ones held at the edge outside the scroll. Tapping one lets Android fill the field: Hex lays the service’s views out and never reads a login, a code or a card, and nothing is logged or sent. A new field, the keyboard hiding or the toggle turning off clears them. Off, Hex makes no inline request, so Android’s own autofill dropdown is exactly as before. Keyboard › Spatial autocorrect controls tap-based correction; it starts on to preserve existing Android behavior. Turning it off keeps dictionary completions and the fixed English typo/contraction rules; turning off Keyboard › Autocorrect disables all automatic replacements.

Privacy › Privacy policy opens the Android policy text even in airplane mode.

Send feedback

Home’s Send feedback opens a form: Problem, Idea, Question or Other (Other sends no category), an optional subject, the message, up to five pictures and an optional email. Nothing is sent until Send. Then the app makes one multipart POST https://api.blhp.app/v1/feedback to Bellhop, Anomaly’s feedback inbox, with HttpURLConnection and a hand-built body, following Bellhop’s checklist: upload progress; an Idempotency-Key made at the tap and reused for every retry; network failures and 5xx retried with the same body after 1, 2 and 4 s; 409 request_pending and 429 retried after Retry-After (up to a minute), no other 4xx; limits and the email’s shape checked before sending. 401 and 403 feedback_disabled show feedback as unavailable and log a warning (debug builds; R8 strips every android.util.Log call from release and preview).

The first picture is Hex’s own window, drawn with PixelCopy just before the form opens, never the screen, the keyboard or another app; Home’s dictation result is painted over first, so no transcript leaves the phone. More come from Android’s photo picker (no permission). Every picture is re-encoded as JPEG at 80% with the longest side at most 2048 px. With an email, the request carries it and a random install ID kept in the app’s preferences (made at the first such send); without one it is anonymous: no email, install ID or user. Metadata is the screen, the channel (play or preview), the speech model and the dictation language. Dictations, transcripts, recordings, vocabulary and corrections are never sent, and the keyboard has none of this.

The report key is the Gradle property hexFeedbackKey (in gradle.properties; publishable, it can only send feedback to Hex), surfaced as BuildConfig.FEEDBACK_KEY. A build without it has no Send feedback. Debug builds log each request without the key (adb logcat -s HexFeedback), and am start -n ly.anoma.hex/.MainActivity --ez feedback_drop_first_response true loses the first answer to show the retry returns the same issue.

Phase 4 verification

On identical held-out synthetic taps and unchanged English and Spanish iOS models, Android’s English word error rate fell from 10.53% to 7.40%, against 8.39% for iOS R1 without offsets. Spanish was 10.33% against 10.43% for iOS (phase 3 Android: 10.06%). The step-by-step benchmark explains the original 298 extra English errors; the replay table gives raw counts, exact sentences and timing.

The Studio verified Spanish, German and Bokmål suggestions and space-triggered corrections in a separate Android app, including ¿¡, ß and æøå. The German and Bokmål assets were also copied, byte-for-byte, into the iOS typing-model folder in local commit 230a437e. The production Swift reader checked all 95,000 words per language and every stored pair score; no iOS source or existing English/Spanish model changed.

With airplane mode on and Wi-Fi off, fixed audio went through the emulator microphone and Whisper small into that editor. Spanish “Nos vemos mañana en la estación” and German “Wir treffen uns morgen am Bahnhof” matched. Bokmål “Tusen takk for hjelpen” also matched; on corpus clip 40 Hex inserted “Biblioteket stenger tydelig på lørdag” instead of “Biblioteket stenger tidlig på lørdag.” The same Spanish clip also produced a transcript from Home’s Dictate bar.

Five unit tests passed in each of the debug and release variants. Home, the four settings pages and all four detail pages were captured in light and dark. Deselecting Hex as the current keyboard changed Ready to Finish setup · 1 step; selecting it again through setup restored Ready. The local APK, full-size screenshots, replay results and Studio log are under build/phase4-proof/.

How it works

  • App: Kotlin and Jetpack Compose. Welcome → microphone permission and Android’s keyboard settings/picker → a real practice field. Setup reads live system state; it remembers the page, not the words.
  • Keyboard: HexKeyboard is an InputMethodService with native key views. Letters, shift/caps lock, symbols, delete, editor actions and next keyboard use Android input APIs; in a TYPE_NULL editor (a terminal) delete, the space bar’s cursor slide and Enter are key events, since the editor’s text can’t be read or edited. It commits through the active InputConnection; changing editors or hiding the keyboard discards pending results. Password fields allow typing only. Typing lives in KeyboardEngine, which reaches the editor only through KeyboardTextTarget; the views are KeyboardView (strip, keys or Hex menu), StripView and KeyPlaneView; each layout's letters are data in KeyboardLetters. KeyPlaneView turns a letter touch that travels a key's pitch into a swipe and draws its trail (SwipeTyping). While the finger moves, the path is read off the main thread every 70 ms; on lifting it is read on the main thread.
  • Audio: MicCapture records up to 60 s of mono 16 kHz PCM in RAM and releases the microphone before CPU inference. Whisper hears only the speech: from 0.3 s before it to 0.5 s after it; pauses in between stay. Speech is a stretch of voiced 40 ms blocks (RMS above −48 dBFS, the test that also decides “No speech heard”) less than 0.3 s apart with at least 120 ms of voice, so a click, a knock or the tap on ✓ doesn’t count. Quiet around the speech only slowed it down and added stray words: on the Studio, 3 s of speech in a tap that waited for the 1-minute limit took 8.5× as long and ended with an invented “you”; trimmed, it takes as long as the 3 s alone, and the 40 benchmark clips and 15 long ones keep the same text. The recognizer interface operates on that capture and its language/task. Hex requests no audio focus and does not change playback routing.
  • Speed: the model loads when the Hex key goes down, while the person speaks, and stays loaded between dictations; it is freed 2 minutes after the last one or when Android runs short of memory, and nothing runs while it waits. The encoder's window is sized to the speech for dictations up to 8 s (speech plus 3.84 s, at most the earlier 512 frames); longer ones, and the bundled tiny model, keep Whisper's full 30 s window, since every shorter one tried cost accuracy. Inference uses one thread per fast core (at least half the strongest core's cpu_capacity), at most four. On the 40-clip benchmark this cut the emulator's median from 0.76 s to 0.56 s with the same word errors (5.26%). A decode may write at most 15 tokens a second of audio plus 16 (Whisper’s own limit is 220 per 30 s window), and one that fails Whisper’s checks is retried once, greedy then 0.2, with one decoder instead of five at each of five temperatures, so a language the model handles badly can’t run on for seconds. ✕ and Home’s Cancel stop a decode in progress (whisper.cpp’s abort callback, asked after each encoder pass and each token), so the next dictation waits at most for the encoder pass under way, not the whole abandoned decode.
  • Type: unmodified InterVariable.ttf from Rasmus Andersson and the Inter Project, v4.1, licensed under SIL OFL 1.1. One Compose font family and native TextView helper cover Hex’s text, including keys, menus, strip labels and tabular digits (tnum). Android supplies missing glyphs; permission dialogs and the system keyboard picker use the OS font. Gradle verifies the bundled TTF’s SHA-256.
  • Licences: OpenAI Whisper weights and whisper.cpp/ggml are MIT. Kotlin/AndroidX are Apache 2.0; libc++ is Apache 2.0 with LLVM exceptions. Bundled credits and licence texts. No ML Kit, Parakeet or third-party language packs are shipped.

Build and run

Use the Studio’s JDK 21, SDK platform 36, NDK 27.2.12479018 and CMake 3.22.1. The Play packaging checks use Build Tools 36.0.0 and bundletool 1.18.3. From the synced android/ directory, with an ARM64 emulator or phone running:

export JAVA_HOME="/opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home"
export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH="$ANDROID_HOME/platform-tools:$JAVA_HOME/bin:$PATH"
./gradlew assembleDebug
./gradlew test
adb install -r app/build/outputs/apk/debug/app-debug.apk
adb shell am start -n ly.anoma.hex/.MainActivity

On the headless Studio, start an ARM64 AVD with -audio none -grpc 8566 -grpc-use-token. inject.py uses the matching emulator discovery record and streams paced mono PCM16 into the guest microphone. Generate the bindings from the SDK emulator’s lib/emulator_controller.proto with grpcio-tools, then put them on PYTHONPATH. No recording or transcript is injected directly into the application.

For the upload bundle, run ./gradlew :app:bundleRelease. Release packaging requires a private properties file at ~/.config/hex-android/keystore.properties or the path in HEX_ANDROID_KEYSTORE_PROPERTIES. It must contain storeFile (relative to that file, or absolute), keyAlias, storePassword and keyPassword. Release uses R8 and resource shrinking and never falls back to the debug key. Gradle writes app/build/outputs/bundle/release/app-release.aab.

Hex Preview (outside Google Play)

Hex Preview is the preview build type: the release build as an APK, application id ly.anoma.hex.preview, named Hex Preview in the launcher and in Android's keyboard list, so it installs beside Hex from Google Play with its own settings, words and speech model. It is signed with its own key (never the Play upload key), read from ~/.config/hex-android-preview/keystore.properties or HEX_ANDROID_PREVIEW_KEYSTORE_PROPERTIES; every build must be, because Android refuses an update signed with any other. The certificate's SHA-256 is 13:35:68:F6:F0:61:4F:E5:7B:C8:8D:AE:CA:32:AF:A7:2C:6A:B7:40:20:26:29:F7:52:FA:A0:33:BE:35:D9:8E.

Its update check lives only in app/src/preview (code, strings); debug and release build app/src/play's empty Updates, which is inlined away, because Google Play forbids an app updating itself. It reads latest.json on the android-preview branch when the app opens and at most once a day when the keyboard opens (never in a password field; Settings › Check for updates automatically). Hex Preview installs nothing itself and asks for no install permission: Download update opens the release's APK on GitHub (latest.json's apk.url, accepted only as a GitHub HTTPS address) in the browser, which downloads it. Opening the download, Android's own installer asks whether to update Hex Preview and accepts only an APK signed with Hex Preview's key; the first time, Android asks once to allow the browser to install apps, and after allowing it the person goes back and taps the download again (Back lands on the browser's downloads, not the installer).

scripts/preview-release.sh publishes a build: the build number is the count of commits up to the built commit of dev, the version name <versionName>-preview.<build>, the tag android-preview-<build> (a pre-release, never moved), and the channel branch android-preview holds only latest.json and the README people land on.

Play Protect, before and after publishing. Scan the dry run's APK (android/build/preview/<build>/HexPreview-*.apk) on the Google Play system image system-images;android-36;google_apis_playstore;arm64-v8a (AVD hex-playprotect-vogel), signed out, with no Google account: start it with emulator -avd hex-playprotect-vogel -port 5760 -no-snapshot -audio none, serve the APK's folder with python3 -m http.server <port> --bind 127.0.0.1, open http://10.0.2.2:<port>/<file> in the emulator's Chrome, install it and accept Scan app. It passes on “This app looks safe” (adb -s emulator-5760 logcat | grep VerifyApps shows JIT scan response: {"verdict":"SAFE"}). After publishing, uninstall it and install the published file fresh from the download button on anoma.ly/hex/android, accepting a scan if one is offered, so Google holds a verdict before people's phones ask; a second fresh install then shows nothing from Play Protect (logcat response=15). The preview must never again declare REQUEST_INSTALL_PACKAGES or UPDATE_PACKAGES_WITHOUT_USER_ACTION: of nine test builds, every one that requested it was judged harmful (POTENTIALLY_UNWANTED, generic_malware) after Google's scan, even with no updater code, and every one without it was safe, which is why updates go through the browser.

Scope: Android 12+ (min API 31), target 36, ARM64, six typing models and ten dictation languages. See the Play release evidence, listing drafts, phone screenshots and real-device checklist. The Studio also exercised offline fallback, all four styles, per-dictation translation, both appearances and insertion into a separate app with music playing in earlier phases.