Yes it is. You'd have to start an input method service via bindService and provide the binder from the service as parameter 1 and the id of the service as the second.
An easier way is to just apply android:inputMethod in the xml for the edit field. You still need to code the custom keypad of course. Its not something I would recommend doing unless you have a huge need for it, input methods are a pain in the ass and users like being able to specify their own- they have their own favorite features (swyping, gesture commands, etc) that you won't support.