Android Question (solved, with 1 question) Intent for connected USB-keyboard

D

Deleted member 103

Guest
Hi all,

Is there an intent-filter that tells me if a USB-keyboard is connected?

I found this, but does not say that it is a USB keyboard.
B4X:
"android.hardware.usb.action.USB_DEVICE_ATTACHED"
 
Last edited by a moderator:
D

Deleted member 103

Guest
Now I know how to do that.
For me, it's enough!
B4X:
    If StartingIntent.Action="android.hardware.usb.action.USB_DEVICE_ATTACHED" Then
        ToastMessageShow("USB_DEVICE_ATTACHED:" & StartingIntent.GetExtra("mManufacturerName"), True)
    Else If StartingIntent.Action="android.hardware.usb.action.USB_DEVICE_DETACHED" Then
        ToastMessageShow("USB_DEVICE_DETACHED:" & StartingIntent.GetExtra("mManufacturerName"), True)
    End If
 
Upvote 0
D

Deleted member 103

Guest
B4X:
Log("USB_DEVICE_DETACHED:" & StartingIntent.ExtrasToString))
The line shows approximately:
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…