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 '' 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:

Thanks in advance.


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

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

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:

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