How to develop a custom Soft Keyboard for Android application?
I've got an Math related application I've made that I really would like to make a custom soft keyboard for. It would have attributes like a numpad and special characters like pi and square root symbols built in. I would want it to replace to default keyboard just for that application, and only open the keyboard that I develop for this app. My question is how do I do that? Do I mak开发者_运维百科e a "keyboard" out of table layouts and a bunch of buttons that opens when I click on the text field, or do I make use of the keyboard layout?
You should not create a table layout and a bunch of buttons, it is an unfamiliar user interface and creates a bad user experience. See this answer about how to create a custom soft keyboard that is identical to the platform soft keyboard but contains the keys you need: android app specific soft keyboard
You could make a RelativeLayout, with rows of buttons like a keyboard at the bottom of the screen(using Linear layouts), or if you need to have a system wide keyboard, I'd look at Hackerskeyboard source for an example.
精彩评论