I have tried your projects USB, USBDetails and USBpl2303Service to get my Eken T02A Android 4.0.3 kernel 3.0.8 to work with a PL2303 serial USB cable.
The device recognises the cable, creates and populates the 1-1 directory :-
event { 'add', '/devices/platform/sw_hcd_host0/usb1/1-1', 'usb', '', 189, 4 }
path : '/sys/devices/platform/sw_hcd_host0/usb1/1-1'
VID :size 5,vid_path '/sys/devices/platform/sw_hcd_host0/usb1/1-1/idVendor',VID '067b'.
PID :size 5,Pid_path '/sys/devices/platform/sw_hcd_host0/usb1/1-1/idProduct',PID '2303'.
But when I run any of the above projects and add :-
Log("Device Count " & usbdevices.Length)
the number of devices found is zero.
The device does have usb_modeswitch installed but I don't think that should affect anything.
cmd=/system/etc/usb_modeswitch.sh /system/etc/usb_modeswitch.d/067b_2303 &,
excute ret : 0,err:No such file or directory
I don't think I am doing anything wrong, maybe has something changed in Android 4 to screw up your USB library?
I also modified your USB ADB example as follows :-
Sub FindAdbDevice As Boolean
Dim usbacc() As UsbAccessory
Dim usbdevices() As UsbDevice
usbdevices = manager.GetDevices
usbacc = manager.GetAccessories
Log("Device Count " & usbdevices.Length)
Log("Acc Count " & usbacc.Length)
It appears that the GetAccessories has a problem too :-
main_findadbdevice (java line: 503)
java.lang.NullPointerException
at anywheresoftware.b4a.objects.usb.UsbManagerWrapper.GetAccessories(UsbManagerWrapper.java:88)
at anywheresoftware.b4a.samples.usb.main._findadbdevice(main.java:503)
at anywheresoftware.b4a.samples.usb.main._btnconnect_click(main.java:257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:136)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:124)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:120)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:49)
at android.view.View.performClick(View.java:3511)
at android.view.View$PerformClick.run(View.java:14109)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
java.lang.NullPointerException
Please could you check Android 4 compatibility with USB library?
Thanks
Andy.
The device recognises the cable, creates and populates the 1-1 directory :-
event { 'add', '/devices/platform/sw_hcd_host0/usb1/1-1', 'usb', '', 189, 4 }
path : '/sys/devices/platform/sw_hcd_host0/usb1/1-1'
VID :size 5,vid_path '/sys/devices/platform/sw_hcd_host0/usb1/1-1/idVendor',VID '067b'.
PID :size 5,Pid_path '/sys/devices/platform/sw_hcd_host0/usb1/1-1/idProduct',PID '2303'.
But when I run any of the above projects and add :-
Log("Device Count " & usbdevices.Length)
the number of devices found is zero.
The device does have usb_modeswitch installed but I don't think that should affect anything.
cmd=/system/etc/usb_modeswitch.sh /system/etc/usb_modeswitch.d/067b_2303 &,
excute ret : 0,err:No such file or directory
I don't think I am doing anything wrong, maybe has something changed in Android 4 to screw up your USB library?
I also modified your USB ADB example as follows :-
Sub FindAdbDevice As Boolean
Dim usbacc() As UsbAccessory
Dim usbdevices() As UsbDevice
usbdevices = manager.GetDevices
usbacc = manager.GetAccessories
Log("Device Count " & usbdevices.Length)
Log("Acc Count " & usbacc.Length)
It appears that the GetAccessories has a problem too :-
main_findadbdevice (java line: 503)
java.lang.NullPointerException
at anywheresoftware.b4a.objects.usb.UsbManagerWrapper.GetAccessories(UsbManagerWrapper.java:88)
at anywheresoftware.b4a.samples.usb.main._findadbdevice(main.java:503)
at anywheresoftware.b4a.samples.usb.main._btnconnect_click(main.java:257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:136)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:124)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:120)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:49)
at android.view.View.performClick(View.java:3511)
at android.view.View$PerformClick.run(View.java:14109)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
java.lang.NullPointerException
Please could you check Android 4 compatibility with USB library?
Thanks
Andy.