问题
I am beginner in android and working on custom keyboard. I have created in English language. Now I want to add some more languages like Russian and Arabic.
I have taken reference from http://code.tutsplus.com/tutorials/create-a-custom-keyboard-on-android--cms-22615
My question is how to find russian alphabet codes for Android? should I use utf-8, unicode or something else?
I have made XML file for Enlgish like this
<Row>
<Key android:codes="97" android:keyLabel="a" android:keyEdgeFlags="left"/>
<Key android:codes="115" android:keyLabel="s"/>
<Key android:codes="100" android:keyLabel="d"/>
<Key android:codes="102" android:keyLabel="f"/>
<Key android:codes="103" android:keyLabel="g"/>
<Key android:codes="104" android:keyLabel="h"/>
<Key android:codes="106" android:keyLabel="j"/>
<Key android:codes="107" android:keyLabel="k"/>
<Key android:codes="108" android:keyLabel="l"/>
<Key android:codes="35,64" android:keyLabel="\# \@" android:keyEdgeFlags="right"/>
</Row>
I want to make something similar(xml) to this for Russian languages or other better approach. With this approach only problem is I don't know android:codes for russian that works with all android device.
回答1:
You can use 'unicode of russian symbol' as key and 'russian symboal' as label
XML file for Russian like this
<Row>
<Key android:codes="1081" android:keyLabel="й" />
<Key android:codes="1094" android:keyLabel="ц"/>
<Key android:codes="1091" android:keyLabel="у"/>
</Row>
来源:https://stackoverflow.com/questions/34870025/how-to-create-custom-keyboard-with-russian-alphabet