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.
Android allows you to download additional 3rd party keyboards (not just other languages, but also alternate layouts and typing methods). In addition to getting the keyboard, you have to “activate” it in your Settings under System -> Languages and Inputs -> Virtual Keyboards.
What to Know. Go to Settings > System > Languages & input. Tap Virtual keyboard and choose your keyboard. You can switch between keyboards by selecting the keyboard icon at the bottom of most keyboard apps.
A soft keyboard (sometimes called an onscreen keyboard or software keyboard ) is a system that replaces the hardware keyboard on a computing device with an on-screen image map .
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.
The Android Nethack application has a complete and clear source code example of how to create a custom keyboard for an application, how to display it on screen and how to define multiple keyboard layouts. It contains pretty much everything you need to know.
It is by far the best example I have seen.
http://code.google.com/p/nethack-android/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With