Android Question usb card reader

zmrcic

Member
Licensed User
Longtime User
hi...I was following this example

B4X:
Private jo As JavaObject
Manager= GetContext.RunMethod("getSystemService", Array("usb"))
mReader=jo.InitializeNewInstance ("com.acs.smartcard.Reader",Array As Object (Manager))

    umanager.Initialize
    Dim usbdevices() As UsbDevice
    usbdevices = umanager.GetDevices
    For i = 0 To usbdevices.Length - 1
        udevice = usbdevices(i)
    Next
    If udevice.IsInitialized = False Then Log("ADB device not found.")
    If umanager.HasPermission(udevice) = False Then
        umanager.RequestPermission(udevice)
    End If


device=mReader.RunMethod ("open",Array  (uDevice)) 'on this line I get error

Caused by: java.lang.IllegalArgumentException: The device is not supported.

in documentation:
"
reader.open(device)

will throw IllegalArgumentException if the UsbDevice object is not supported or it cannot be opened due to communication error. "

this is not the case since I read card from android APDU sender, windows apps....
 

zmrcic

Member
Licensed User
Longtime User
it means that other apps are reading the card....
my guess is that error is in part initializing manager or reader...
 
Upvote 0
Top