Anki Desktop for iOS, Android and web

Kioku, an Android app that runs the unmodified Anki desktop (Qt 6 + Qt WebEngine) natively on your phone. Install the APK, tap the icon, and a small touch-friendly Linux desktop starts with Anki already open.

Download: Release Kioku 0.2.3 · krmanik/kioku · GitHub
Source: GitHub - krmanik/kioku: Anki Desktop for iOS and Android · GitHub

Why

AnkiDroid is great, but some things exist only in Anki desktop: add-ons, the desktop card browser, editors and tools. Until now, running desktop Anki on a phone meant installing Termux, Termux:X11, a proot Linux distro, and a lot of setup.

Kioku does that in one APK:

  • One-click install and run. No Termux app, no Termux:X11 app, no commands to type.
  • No proot, no second Linux distro. Anki and its dependencies (Python, Qt 6, WebEngine) are built natively for Android from Termux packages, so it runs directly without proot overhead.
  • Desktop Anki with add-ons. Your decks, media, add-ons and settings stay on the phone and survive app updates.

Features

  • Made for touch: drag to scroll with momentum, big text and buttons, keyboard opens when you tap a text field. Optional mouse-pad mode.
  • Small phone desktop: launcher, dock with open windows, wallpapers, portrait and landscape.
  • Import .apkg / .colpkg from your phone, or open/share them to Kioku from other apps. AnkiWeb sync works as usual.
  • Optional Linux apps on demand (file manager, text editor, terminal, browser…), installed only if you want them.
  • Recovery if start-up fails: Retry, Safe mode (Anki without add-ons), Repair runtime (decks kept), Share log.

Requirements

  • 64-bit ARM phone (arm64-v8a), Android 7+
  • About 1 GB free storage, 3 GB RAM or more recommended
  • First start unpacks the runtime (about a minute)

Tested on a Samsung Galaxy M30s (Android 11, ~4 GB RAM).

Status

This is an early release (v0.1.0). I’d love feedback, especially:

  • which add-ons work or break
  • performance on different phones
  • touch and keyboard issues

Bug reports and ideas welcome here or on GitHub issues.

Kioku is an independent project, not affiliated with or endorsed by Ankitects. Anki is AGPL-3.0; Kioku credits Anki, Termux, Termux:X11, JWM and Qt.

I’ve been working on Kioku, an unofficial project that runs the unmodified Anki desktop app (Anki 26.08.1, aqt) on phones. It isn’t a rewrite or a new client. It’s the desktop code itself, with changes so it fits a touch screen.

Why: AnkiDroid and AnkiMobile are excellent and remain the best choice for most people. A few things only exist on the desktop, though: Python add-ons, the desktop card browser, and some editors and tools. I wanted those on my phone.

Three variants:

iPhone / iPad Android (native) Android (Termux)
Needs iOS 17+ Android 9+, arm64 Android 7+, arm64
Size 39 MB 48 MB 235 MB
How Python, Qt and PyQt6 compiled into the app; WKWebView in place of Qt WebEngine Same, with Android’s WebView A small Linux desktop inside the APK, running Anki with Qt WebEngine as on a PC

What works:

  • Deck list, reviewer, Browse, editor, statistics, deck options, import/export. Tested with collections of up to 258k cards.
  • Desktop add-ons installed from AnkiWeb inside the app. I tested 15, including AnkiConnect, Review Heatmap, HyperTTS, Advanced Browser and Edit Field During Review.
  • AnkiWeb sync, including media (tested on Android).
  • Windows open full screen, and popups stay above the keyboard.

Known limits:

  • iOS: ogg/opus card audio doesn’t play yet, and add-ons that start other programs (such as MeCab in Japanese Support) can’t work, because iOS doesn’t allow it.
  • iOS install is by sideloading for now (AltStore source or the .ipa with Sideloadly, use alternate Apple ID).
  • Kiouku experimental software. Please back up your collection before trying it.

Download and source: GitHub - krmanik/kioku: Anki Desktop for iOS and Android · GitHub (AGPL-3.0, same as Anki)

This is an independent project, not affiliated with or endorsed by Ankitects. If you use Anki on iOS, please keep supporting AnkiMobile: it funds Anki’s development.

I’d really appreciate bug reports, especially which add-ons work or break for you. Issues on GitHub or replies here are both welcome.

This is so cool! Will test it out soon! I had a few feature requests (added as an issue)

Symlink support for AnkiDroid, or a way to point Kioku to the AnkiDroid folder directly. I know it may be difficult to target the /Android/data location, but if users could point it to a mounted folder such as /sdcard/AnkiDroid (which is possible with the dev build), that would be a very useful addition.

Or at least to collection.media

VNC / remote X11 support. Imagine using your Android phone (maybe iOS too but idk how feasible that is lol) as a remote server for a full Anki Desktop environment, then accessing it from any device on your local network or via Tailscale. That would make it possible to run the full desktop app, including add-ons and all the standard local setup, from a guest computer or another machine (and also saves storage/sync).

These are just suggestions, but I think they could be really cool features if they’re feasible.

Will let you know about Add-on compaitability with a few of my favs

Thanks, glad you like it! Both ideas are doable, with a few caveats.

AnkiDroid folder
An AnkiDroid folder is laid out just like an Anki desktop profile, so I’m planning an “Open AnkiDroid folder” option for the native Android app. It will ask for All files access and open the collection directly (shared storage doesn’t support symlinks).

But

  • Only one app can have the collection open at a time, because Anki locks the database. So, need to fully close AnkiDroid before opening it in Kioku, and the other way round.
  • It only works with AnkiDroid builds that keep data in /sdcard/AnkiDroid. The Play Store build uses Android/data, which other apps can’t read on Android 11+.
  • The safer option, which works with any AnkiDroid build, is a local sync server. Anki’s sync server is already built into Kioku, so, point AnkiDroid’s custom sync URL at http://127.0.0.1:8080. The two apps never share a database file, so nothing can get corrupted.

I will implement the local sync server based solution.

VNC / remote desktop: Planned for the Termux variant, since it already runs the full desktop. It would be Xvnc plus noVNC, so any browser on your network or over Tailscale gets the full Anki desktop with add-ons.

The native iOS and Android apps can’t do this. Their cards are drawn by the system web views, not Qt, so they’d come through blank over VNC, and iOS suspends background apps anyway.

This is very cool @krmanik , let me know if I can make it easier to enable such projects as the developer of HyperTTS.

[I merged this into your original post from a few days ago.]

Anki Desktop compiled to wasm running in browser kioku/web at main · krmanik/kioku · GitHub

Try here (experimental)

I’ve been meaning to try doing something like this just for myself to enable my very addon-heavy review flow, so this is really great!

I’m testing how all my personal addons run on native Android. One immediate problem is that my addons do run programs, MeCab being one of them. I’ll see if I can figure out a workaround that’ll work for my addons that could provide a general solution for others too. I pretty much would not use Kioku, if I can’t get those working, so I’m motivated to try.

Mecab will not work, need to build for iOS and Android. I had built mecab for wasm earlier, it may be easy to integrate.

misaki-wasm/build_mecab_wasm.sh at main · krmanik/misaki-wasm · GitHub

Claude got MeCab running in Kioku’s native Android build, without wasm. This approach won’t work for iOS but ought to work for any add-on whose program can also be built as a library.

Summary below by Claude.


Android allows loading a .so. An app can’t start programs from shared storage, nor, from Android 10 on, from its private storage. But it can load a shared library (.so) from its private storage into its own process, which is how Kioku’s Python loads its own modules. Python’s ctypes, included in python.org’s Android build, can then call the library’s C functions directly.

Building MeCab. MeCab was built from v0.996 of taku910/mecab as libmecab-android-arm64-v8a.so with the Android NDK. It depends only on Android’s built-in system libraries.

Shipping and loading it from an add-on. The add-on ships the .so in its own folder. Android won’t load code from shared storage, where add-ons live, so on Android the add-on copies the file into the app’s private cache folder, which Kioku sets as TMPDIR, and loads the copy with ctypes. Naming the copy after a hash of its contents lets add-ons that bundle the same library share one copy, while an updated build gets a new name. Files the library only reads, such as MeCab’s dictionaries, can stay in the add-on folder.

Generic script for loading bundled .so library
import ctypes
import hashlib
import os
import sys
import tempfile


def load_bundled_library(path):
    """Load a .so shipped in the add-on folder; on Android, load a private copy of it."""
    if sys.platform != "android":
        return ctypes.CDLL(path)
    with open(path, "rb") as f:
        data = f.read()
    folder = os.path.join(os.environ["TMPDIR"], "my_addon")
    os.makedirs(folder, exist_ok=True)
    copy = os.path.join(folder, f"lib-{hashlib.sha256(data).hexdigest()[:16]}.so")
    if not os.path.exists(copy):
        fd, tmp = tempfile.mkstemp(dir=folder)
        with os.fdopen(fd, "wb") as f:
            f.write(data)
        os.replace(tmp, copy)  # never a half-written file under the final name
    return ctypes.CDLL(copy)

iOS. This probably won’t work on iOS, since iOS only runs code that’s signed into the app itself.

Build details
  • MeCab 0.996, taku910/mecab at commit c6e0609, built with NDK r29 for API level 28 (Android 9+), arm64-v8a.
  • libc++ is linked in statically and hidden, so only Android’s libc, libm and libdl are needed, and only MeCab’s C API (mecab_*) is exported.
  • Segments are aligned to 16 KB, so it also loads on devices with 16 KB memory pages.
  • Built without iconv, which MeCab only needs for compiling dictionaries.
  • The build is reproducible: the same commit and NDK give the same bytes.

The build script is support/build_libmecab_android.sh in my fork of mecab_controller.

I have tried to find all external programs that may be used by anki addons.
Some of them are:
FFmpeg, LAME, MeCab, KAKASI, Tesseract OCR (English, Japanese, Chinese, Korean), eSpeak NG and cwebp/dwebp
I also bundled it in the app, but the size increased significantly and on iOS it is not possible to download and run, it needs to bundled with app.

kioku/docs/addon-deps.md at main · krmanik/kioku · GitHub

Very cool project, I was working on something similar for my own use last week, then I discovered you.

I only compiled the rust core to wasm and rewrote the Qt shell. So it’s light (~5MB), but of course it can’t run the addons. However regarding how good the agents are today, probably nearly all of the addons can be ported to run like this in half an hour

source: https://github.com/ytkimirti/ankianywhere

But to be fair I like you approach a lot, excited to see where this will go

Does this have iPhone Duo native support?

Seems to be working

Sounds good I’ll give it a go tonight. Good alternative until ankimobile decides to get their stuff together