In search for a better keyboard

April 01, 20252 min. read

postmarketOS phone showing the new keyboard with autocorrect

In our previous blog post 2025 Priorities: Reliability, Audio, Cameras and More, we asked "is there anything that you find terribly important that we have missed here?". And indeed, there was one thing that people would have liked us to focus more on, which is a better keyboard experience.

This was unbelievably great timing, because we are actually integrating a new keyboard with the following features:

We have hooked it up to Phosh, see it for yourself (this is a video, you might need to click it in order to have it start playing):

Tech stack

Please note that this is in early development. Currently it is still crashing often and you also need to be comfortable running proprietary software since this is actually Gboard running through ATL. So uh… on second thought we will not be shipping this in postmarketOS. However the underlying technology is very much worth showcasing since it allows running components and apps from that other operating system on proper Linux (Mobile) without running a full container! The video is real, and it shows that it is possible to build features like autocorrection and swiping with the APIs we already have in Linux Mobile today. In fact, phosh-osk-stub and swipeGuess can do most of this already! If somebody out there has the interest, skills and time to improve the Linux mobile keyboards to the point that they work as intuitively as proprietary ones: it is possible, get involved!

Try it for yourself

If you really want to, you can now run this proprietary piece of TensorFlow based software to tap into the results of training data from millions of Android user's keystrokes while tapping with your fingers on your postmarketOS phone. You can also use these instructions with the open source Hacker's Keyboard.

Build ATL from sources:

sudo apk add -t .atl-builddeps \
        libopensles-standalone alsa-lib-dev bionic_translation-dev art_standalone-dev \
        ffmpeg-dev glib-dev gtk4.0-dev java-common libandroidfw-dev libgudev-dev \
        libportal-dev meson openjdk8-jdk openxr-dev vulkan-loader-dev webkit2gtk-6.0-dev \
        gtk4-layer-shell-dev apache-ant

git clone --depth=1 \
          --branch keyboard \
          --single-branch \
          https://gitlab.com/android_translation_layer/android_translation_layer.git

cd android_translation_layer
meson setup build
cd build
meson compile api-impl.jar
meson compile

Now, get the Android apk for your keyboard of choice. Gboard 9.9.14.333092878 was showcased above, Hacker's Keyboard should also work.

sha256sum gboard.apk
# 411c1530ea8c37f47788ac487abff8dd174274c2554343ca4024e95c3a7c9e89  gboard.apk

Login via SSH while using the session environment (i.e. open tmux in local terminal, detach and close terminal app, attach over ssh), then open your text editor of choice on the device (GNOME Text Editor used in demos). In SSH/local terminal cd to the atl build dir and then:

LINKER_DIE_AT_RUNTIME= RUN_FROM_BUILDDIR= LD_LIBARY_PATH=. GSK_RENDERER=ngl ./android-translation-layer ~/gboard.apk \
        -l 'android.inputmethodservice.ATLKeyboardViewer' \
        -e 'kb_class=com.android.inputmethod.latin.LatinIME'

Wait for the apk to compile (and possibly crash for first boot). After you see keyboard(/empty space) pop up, kill squeekboard:

killall squeekboard

Then wait for sad face to appear, touch bottom of the screen and switch back to the editor. Now, if the keyboard is blank or if you crashed it, ^C and restart atl command above. Try typing/changing layouts/swiping/completing and see what works, what's buggy and what crashes the keyboard.

Thanks

Big thanks to Mis012 for his amazing work implementing keyboard support in Android Translation Layer and to Nikita for integrating it into Phosh for this initial demo!