views:

244

answers:

1

I have an application where I would like to warn the user if they are not using the default Android softkeyboard. (i.e. they are using Swype or some thing else).

How can I check which input method they currently have selected?

Thanks

+1  A: 

InputMethodManager has getEnabledInputMethodList(). You get an InputMethodManager from getSystemService() in your Activity.

CommonsWare
I saw that and that returns a list of input methods that are available to the user - but I can't seem to figure out how to determine which one is currently selected.
jkhouw1
Unfortunately, the only thing I can think to do now is check the length of the List returned by getEnabledInputMethodList and if >2, warn them that they _may_ have a problem if they're not using the default IME. Anyone have any other pointers/ideas?
jkhouw1
You might consider opening up a new SO question about the problem you think you will experience with users using Swype, and figure out how to fix that. After all, I suspect the range of "default IME" will expand as Android moves into other markets (e.g., TVs/set-top boxes). Hence, I would really recommend we figure out how to get it so you don't care what IME they're using.
CommonsWare
hmm - ok I can try that...
jkhouw1
Actually - I fixed the problem I was having with swype and a TextWatcher on an EditText However, I still need to determine if they are using the default keyboard or not. (Its for a game where speed of entry matters and you can "Cheat" with swype type keyboards.
jkhouw1
Do you care if they cheat? Unless you're doing multi-player, I don't see why it matters.
CommonsWare
Actually I do - I will have an online score - and am hoping to implement bluetooth head-to-head battles. I'd go further and do online battles, but setting up a networked user matching server is more than a bit beyond me.
jkhouw1