How to create a custom keyboard that looks like the standard one

I am experimenting with custom ime on android. The sample SoftKeyboard app seems to show everything I need except how to make the keyboard look like the standard one (colors, hover effects, sizes etc.). It seems like reusing resources from the standard keyboard sources could work, but I receive errors when trying to compile them like:

error: Error: No resource found that matches the given name: attr android:layout_alignParentStart'.

Commenting these errors produce lots of other XML errors, like:

error: No resource identifier found for attribute 'additionalMoreKeys' in package 'com.android.inputmethod.latin' key_f1.xml

Is there some semi automatic a way to fix these errors and make them compile?

I have got the sources from here: https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/android-4.4.2_r2

Thanks in advance.

Answers


That depends on your purpose. If you want to create keyboard specifically to any activity then follow below tutorial.

http://tutorials-android.blogspot.in/2011/06/create-your-own-custom-keyboard-for.html

Or if you want to create keyboard that will replace default keyboard in all applications then following answer will be helpful to you.

https://stackoverflow.com/questions/14806087/android-facebook-emoji-keyboard/14826813

As you said you want to change layout of keyboard then read this.


You could browse the android source code: android.inputmethodservice.KeyboardView and android.inputmethodservice.Keyboard and look for the specific behaviour you want.


The keyboard found in android is open source, along with most of the other packages found in the OS. You can see the code here: https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/android-4.4.2_r2


Need Your Help

Finding subsets of size k for a given set of size n

java generics recursion set time-complexity

I am trying to work out the solution to the above problem and I came up with this