0

I want to use a series of Unicode characters outside of Unicode BMP (Basic Multilingual Plane - range from U+0000 to U+FFFF), for a custom android keyboard. My characters are from U+16B00 - U+16B8F.

I can display the Unicode character on the key (keyboard display), but it doesn't print out to the text field.

The Android XML uses the android:codes with a decimal value, but doesn't seem to support decimals after 65,535???

<Key android:codes="92928">

I followed a tutorial to build the keyboard and it runs fine, I just don't know how you can go around printing out the Unicode decimal values after decimal 65,535. For example, once you assign 65,536 (or over), it wraps around and points the value back to the beginning, so 65,537 and 0 would be the same character and so on.

To output Unicode characters, you can also use '/uXXXX;' instead of a decimal, but that doesn't seem to work pass the limit either.

According to this post, there's a way around it for doing it with Java source code, but not in resource XML.

Is the Android UTF-8 parser to blame here?

Any help is appreciated.

<Row>
    <Key android:keyLabel=""
        android:keyEdgeFlags="left"
        android:codes="92928"/>
</Row>
Billy
  • 13
  • 3
  • How serious of a keyboard are you trying to make? Because if you want anything like a full featured, usable keyboard, you won't be using KeyboardView and this post is moot. (KeyboardView is ok for a demo or proof of concept, but no serious keyboard uses it) – Gabe Sechan Sep 22 '20 at 01:49
  • I'm only building it for a small group, but what would you recommend for building a serious custom keyboard for Android? I would need it to be able to map non-BMP Unicode characters either way. Thanks! – Billy Sep 22 '20 at 03:33
  • Custom view integrating with the app using InputConnection. The problem with KeyboardView is that its completely inflexible. If you don't want to just do the bare basics of what a keyboard to do then its useless. – Gabe Sechan Sep 22 '20 at 18:16
  • @GabeSechan Will look into it. Thanks! I appreciate the suggestion. – Billy Sep 22 '20 at 19:52

0 Answers0