How to Develop a Soft Keyboard For Android

How to develop a soft keyboard for Android?

Some tips:

  • Read this tutorial: Creating an Input Method
  • clone this repo: LatinIME

About your questions:

An inputMethod is basically an Android Service, so yes, you can do HTTP and all the stuff you can do in a Service.

You can open Activities and dialogs from the InputMethod. Once again, it's just a Service.

I've been developing an IME, so ask again if you run into an issue.

Create a custom soft keyboard for Android

Here a tutorial to make a keyboard inside your app.
To create a input method with a service: tutorial
You will have to set every key you want, then put just numbers and lettters.
To make a key is like this:

<Key android:codes="113"    android:keyLabel="q" />

Here you can find the keycodes.

create a android soft keyboard with other views attached to it

Keyboards must implement an InputMethodService. One of the functions on it is onCreateInputView. That returns the View to display. This can be any View you want, including q layout with ads.

That said- nobody will ever use a keyboard with ads on it. I really don't suggest it.

Android custom soft keyboard (Android Studio)

I can see you not close properly the tag Keyboard.

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

Should be written:

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


Related Topics



Leave a reply



Submit