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 need to use a
BroadcastReceiverand register it for an intent filter for Bluetooth actions. You will have to search the USB API for the other.BroadcastReceiver‘s onReceive method will handle these activities.