views:

1070

answers:

1

Hi,

Is there a way to create an app specific soft keyboard on Android? After reading about InputMethodService docs and checking out alternative keyboard apps out there, I figure the alternate keyboard can only be configured for system wide usage (through Settings -> Locale and Text).

If the answer to above question is no, then is there at least a way to load a custom dictionary and override the default dictionary of the system keyboard (only when my app is in use)? That will help in giving very relevant suggestions to the user when he has only tapped couple of keys.

Thanks.

+3  A: 

If you just want a View that looks and acts like a soft keyboard, I did that in my SmallKeyboard class. You just need to extend android.inputmethodservice.KeyboardView and decide on layout. See the onKey and onText methods at the end of that file for the action taken when keys are pressed.

Instead of my keyboard model inner class, you could load it from XML if your key set is fairly constant.

Chris Boyle
That looks useful. I installed SGTPuzzles to see how the keyboard works, but I couldn't get it on screen. I only get the redo/undo buttons. Which puzzle will popup the instance of SmallKeyboard?Thanks.
Jayesh
The undo/redo buttons are actually such an instance, but more interesting instances can be seen in puzzles where number entry is required: Filling, Solo, Unequal (and coming soon, Keen and Towers). Also Guess and Map have minimal extra buttons.
Chris Boyle
Thanks. That does the job I guess.
Jayesh