In my app, I have to detect whether an external keyboard is connected to the device to determine what to show to users.
I know the soft keyboard will not show if an external keyboard is connected on my device, Xoom android 3.1.
How can I know whether an Android device have been connected with an external keyboard through an USB or Bluetooth?
Thanks!
you can find out if a bluetooth keyboard is connected to android device with
getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS;
if it returns true then bluetooth keyboard is connected, false otherwise.
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