views:

319

answers:

1

Is there a way to detect if the device I'm currently running on has a hardware keyboard installed?

How do I query device capabilities anyway?

+2  A: 

"The flags provided by getResources().getConfiguration().keyboard are a good way of checking which keyboard (if any) is available." [1]

http://d.android.com/reference/android/content/res/Configuration.html#keyboard

Hostile Fork
Basically that means: private boolean isHardwareKeyboardAvailable() { return getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS; }
Marcus
Yes, if for your purposes you are counting a "12-key keyboard" as a "hardware keyboard".
Hostile Fork