Android Question UsbDevice Productname and SerialNumber

wroyw

Member
Licensed User
Hi,
how can I read the ProductName and SerialNumber from a UsbDevice ?
I can it see in the Watch windows in debug mode, but how can I use that values in my program ?
 

rosippc64a

Active Member
Licensed User
Longtime User
Maybe somebody needs...
B4X:
    Dim UsbDevices() As UsbDevice
    UsbDevices = manager.GetDevices

    If UsbDevices.Length = 0 Then
        ToastMessageShow("No connected usb devices.", True)
    Else
        For z = 0 To UsbDevices.Length - 1
            Dim UsbDvc As UsbDevice
            UsbDvc = UsbDevices(z)       
            Dim jo As JavaObject = UsbDvc
            Log( jo.RunMethod("getProductName",Null))
            Log("USBDeviceNr. " & z & " --- UsbPid = " & UsbDvc.ProductId & " Devicename:" & UsbDvc.DeviceName)
 
Upvote 0
Top