Question

I want to create a custom keyboard which will be available in my application only (It's used jut for a single EditText in one activity), and I was wondering what would be the best way to do so. Here are my specifications for the keyboard:

  • It should always be displayed in the activity it is used (Regardless whether the EditText is focused or not).
  • It will have 2 or more keys layouts (Similar to the regular keyboard which has letters layout and a few numbers/symbols layouts).
  • Some keys may require some special action (Rather than simply adding their android:codes key value to the EditText).
  • It doesn't offer candidates for completion/correction.
  • It doesn't offer more than one input type (Like the regular keyboard which has TYPE_CLASS_NUMBER, TYPE_CLASS_DATETIME and so on...).

How should I develop it? Should I create a full input method service for it? Or should I create just a KeyboardView and add it to the activity's layout? (I want to use KeyboardView for the convenience of keys creation and click events handling)

Was it helpful?

Solution

Since it's a one-off thing and not meant as a separate app, You can simply use whatever method is easiest for you (The KeyboardView method).

Try it out and make sure it's responsive and snappy. If it works, then simple and easy method would be my recommendation.

OTHER TIPS

Maybe you could take a look at this. I think the best way is to make a custom layout and inflate it. Theres a tutorial given here too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top