Bépo layout for LatinIME

ime settingsLatinIME is the default Android keyboard (IME: Input Method Editor) for latin languages. It supports severals layouts including regular qwerty, azerty layouts but also improved layouts like dvorak or colemak. Those layouts improve speed, reduce errors compared to qwerty by reordering keys according to theirs usages. Remember that qwery was designed to avoid mechanic jam on typewriters, not to simplify typings.

As dvorak is designed to improve typing, it not also efficient for other languages than english. This is why specific language variations exist and bépo layout is the french one. It is designed for the same purpose than dvorak but based on the french word letter frenquencies. Here is what it looks like:

bépo layout
Complete bépo layout

As I daily use the bépo layout on my computers, I would also like to use it on my Android devices. So I moded the LatinIME android keyboard to change dvorak to bépo layout. I grabbed the apk from my N7 and decompiled it. All layouts are defined in /res/xml using the following files (for dvorak in this case):

  • keyboard_layout_set_dvorak.xml: main entry point that defines the different keyboard layouts according usage (alphabet, symbols, phone, number, …),
  • kbd_dvorak.xml: layout for alphabat usage that defines keyboard row layout,
  • rows_dvorak.xml: defines the row files to include,
  • rowkeys_dvorak1.xml, rowkeys_dvorak2, rowkeys_dvorak3: define keys for each row (the first to the third).

Based on this study, I patched the dvorak resources to set a bépo layout. I edited the rowkeys_dvorak files and used the french symbols layout. After recompiling it and upgrading it, my N7 has bépo:

bépo layout
Bépo layout screenshot

For those who also want bépo layout, you could get my modded apk. It is based on N7 JDQ39 build. For other devices or builds, you could get source and apply my patch. More screenshots of the result:

More information about bépo layout and LatinIme keyboard:

  • Koala

    Hi, very interesting post indeed.

    I tried to modify the LatinImeGoogle.apk according to your tutorial. I modified the colemak layout accordingly (instead of the dvorak but I think the results would be the same).
    I recompiled the apk and tried to install it on my Nexus 4, and I get an error : “Application non installée”.

    My phone is rooted.

    How can I solve this problem and install the apk ?

    • Hi Koala,

      Did you (re-)sign your application after rebuilding it ? And does your device allows unknow sources (Settings > Security) ?

      • Koala

        OK I think I understood my problem : I sign the app but the certificate does not correspond to the original certificate of the LatinImeGoogle.apk

        I tried several methods to sign and install the keyboard, but none of them worked (adb install, pushing the file on the app folder, using different keys found on the internet…).

        Do you have any idea how to sign the apk with the same key as google ? Or how to workaround this incompatibility of key and install the apk anyway ?

        • Koala

          I did as you said :
          – installed the modde apk by copying it over the existing one.
          – rebooted on recovery to wipe cache and dalvik-cache
          – rebooted.

          The keyboard would appear but made an error (le clavier android doit s’arrêter).

          I then found a post on frandroid which solved this problem : http://forum.frandroid.com/topic/135088-probleme-avec-le-clavier-android-aosp/#entry2392827

          You have to go in /Paramètres/Applications to force-stop the android keyboard and empty the cache, then stop the dictionnary and empty its cache too.

          Now I have my andoid keyboard working almost natively in bépo !!! I modified your version of bépo to better suit my needs, et voilà !!

          Thank you very much for your input and help in this matter, your post and remarks helped me very much !

          • You’re welcome !
            It’s nice if bépo could enter in Android (even slowly with modded apk ^^’).

            I tried to get vote for bépo implementation for keyboards like swiftkey from bépo user forum but without success (I get votes but the improvement stay « under review »).

            I will add a link of this blog entry to the post. May be it could help those who aren’t afraid by android development !

          • Koala

            I voted for this too, a year ago, but it does not seem to be taken seriously by the swiftkey devs.

            Did you post an howto on the bépo forum, with your experience on modifying the stock android keyboard ? If not, would you mind if I did it ?

          • I think I will do it when I have some spare time.
            I add the link to the forum post but an user had the idea to some improvements.
            I would like to test it before post it on bépo.fr.

  • Koala

    Hi again, I tried to re-sign my app with APK multi tool for linux (on the xda-dev forum) and it did not work. My device allows unknown sources.

    I will retry to decompile and recompile again, maybe something went wrong. I keep you posted.

    • As far as I can remember, I installed modded APK using adb. I remount the /system partition with write permission and copy the new apk over the existing one (make a backup before).

      Re-sign may not be suffisent due to current application installed (with same version number, different signature, etc).
      So try to replace apk, wike cacle/dalvitk-cache (to be sure) and reboot.

      I think you could also try to uninstall the current apk and install after the modded one but you might have certificate problems. And also, my ROM is odex and would keep the current odex file (so I didn’t uninstalled but copied over it).