How can I edit the source code of android os keyboard?

I use android keyboard but I want to add a row of keys to it so I downloaded the source code of this keyboard from https://android.googlesource.com/platform/packages/inputmethods/LatinIME/ ,but I face the following error

The import com.android.inputmethodcommon cannot be resolved

import com.android.inputmethodcommon.InputMethodSettingsFragment;

Upvotes: 9

Views: 4226

Answers (2)

Walls
Walls

Reputation: 4010

You are able to create your own custom keyboards in Android to have any number or keys displayed. Using Keyboard, Keyboard.Row, and Keyboard.Key

For more customizing of the keyboard check out this blog post.

Upvotes: 3

Rick
Rick

Reputation: 23

i don't know if you still need help with this, but you don't need the imePreferences file for this you can just delete it. you want to go to the xml folder and the qwerty.xml file there you can add and changes rows and keys. just add a row with the keys you want.

<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:keyWidth="10%p"
android:horizontalGap="0px"
android:verticalGap="0px"
android:keyHeight="@dimen/key_height"
>

<Row>
    <Key android:codes="113" android:keyLabel="q" android:keyEdgeFlags="left"/>
    <Key android:codes="119" android:keyLabel="w"/>
    <Key android:codes="101" android:keyLabel="e"/>
    <Key android:codes="114" android:keyLabel="r"/>
    <Key android:codes="116" android:keyLabel="t"/>
    <Key android:codes="121" android:keyLabel="y"/>
    <Key android:codes="117" android:keyLabel="u"/>
    <Key android:codes="105" android:keyLabel="i"/>
    <Key android:codes="111" android:keyLabel="o"/>
    <Key android:codes="112" android:keyLabel="p" android:keyEdgeFlags="right"/>
</Row> 

Upvotes: 0

Related Questions