[GUIDE] How to get enable Google's gesture typing in AOSP keyboard
This is meant to be a guide for people interested in building AOSP based roms and is strictly for developers only. If you wish to have gesture typing in your rom the most simple way is to include/install "LatinImeGoogle.apk
Not everyone wants to always use google's stock input apk, particularly if you have made modifications into AOSP latinime keyboard if your own and want it to propagate through to your roms without sacrificing gesture input (which i have found is quite useful). Well after some digging around there's good news and bad news.
The good news is that the gesture typing is already in the source tree on the java side and can be enabled by changing packages/inputmethods/LatinIME/java/res/values/gesture-input.xml
or using the overlay in devices/../mako (not within scope of this post).
However, just changing the value you will notice that it will draw the gesture but list no words. Thats because google didnt include the "gesture decoder" in the AOSP sources because it is super secret
. You can see the code stubs in the C++ part of latinime under native/jni/src/gesture/*
As a result, libjni_latinime.so
will not contain code to decode the gestures and will not read from the dictionary.
BUT! There is a way! You can drop in replace the lib from "LatinImeGoogle.apk
" into your system/lib and you will have your gesture decoder!
The library inside the apk is called "libjni_latinimegoogle.so" under /lib/<arch_type>/
inside the apk. You can extract this library from within android using program like root explorer and on PC using android apktool (http://code.google.com/p/android-apktool/
). Rename this shared library to "libjni_latinime.so
" to replace the AOSP built one and it will decode the gestures through the AOSP based keyboard.