Then add the following two xml files to it. (Right click res and choose New > Directory.) For that you should check out the Candidates view. It just shows what key you are pressing (in case your big, fat fingers are covering it). The key preview is a layout that pops up when you press a keyboard key. In this example there is only one keyboard, but you could add other keyboards and swap them in and out of this KeyboardView. This view is like a container that will hold our keyboard. Add the layout filesĪdd the following two files to your app's res/layout folder: I will just leave the MainActivity and 'Hello World!' layout as it is. If there are other features that you need, I provided links to more help at the end. As much as possible I tried to remove any unnecessary code. The following steps show how to create a working custom system keyboard. You can modify it for any keyboard layout. If you want to make a keyboard that will only be used within your own app, then see my other answer. This answer tells how to make a custom system keyboard that can be used in any app that a user has installed on their phone.