B4A Library Usb Host library

Attachments

  • USB.zip
    14.4 KB · Views: 1,552

agraham

Expert
Licensed User
Longtime User
Here's an example that displays all the details of the first USB device it finds connected.

There is presently a bug in UsbDeviceConnection.getRawDescriptors so the Reflection library is used in USBdetails.DeviceDetails(device) instead.

It's quite interesting connecting various USB devices to see what they support.
 

Attachments

  • USBdetails1.1.zip
    8.6 KB · Views: 1,030
Last edited:

msemih2011

Member
Licensed User
Longtime User
Why get the following error when compiling program USBDetails

Compiling code. Error
Error parsing program.
Error description: The index was outside the bounds of the array.
 

msemih2011

Member
Licensed User
Longtime User
No change in the project using the Android version is 3.1 which gives the same result, but did not do it if you tell me that you are using them, I use libs
 

msemih2011

Member
Licensed User
Longtime User
gives the same error when I try to compile the project. I used an android version 3.1. What does such an error?
 

lgbdt

New Member
Licensed User
Longtime User
I'm just getting started with B4A and I've attempted both the USBDetails example and the USB example on my Coby MID8042 and have not had any luck with either application returning a USB device from manager.GetDevices. No matter what USB device I attach, devices[] is empty.

My Coby 8042 has Android 4.0.3 and it appears that USB devices are supported because I can plug in a USB mouse or USB keyboard via the USB Host dongle (provided by Coby) and they seem to work fine in various applications on the tablet. They just don't show up in the example apps...

I found a couple of topics via Google that suggested some tablets support USB devices and USB Host but don't support the USB Host API. Those topics went on to mention that a possible cause is the absence of an 'android.hardware.usb.host.xml file in the /system/etc/permissions folder. And, the absence of '<feature name="android.hardware.usb.host">' in either the handheld_core_hardware.xml or tablet_core_hardware.xml file. In looking in my 8042's /etc/permissions folder, these items do appear to be absent, as suggested.

Have you or any other users encountered this type of problem with the USB Host API on some devices?

Do you think those missing items mentioned could be the problem? If not, do you have other suggestions?

Thanks!
 

lgbdt

New Member
Licensed User
Longtime User
No. It's not rooted. I'm just getting started with android devices and I have not rooted anything yet. So, I'll do some more research on doing that and give it a try.

Thanks!
 
D

Deleted member 103

Guest
Hi Erel,

I have 3 different USB-converter but not recognized by my device, I get the message "No device attached".

I try just using the example "USBdetail" and "USBpl203".
All USB converter have the chipset "Prolific PL-2303".

My device is an HTC-one-s ICS 4.0.3.

Ciao,
Filippo
 
D

Deleted member 103

Guest
That is but even if it would work with my phone not sure it would work with other mobile also.

It would be a better Seriel-Bluetooth adapter or what do you think?
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
How would you get other data types?

Like INTs from a PS3 controller? Or even a mouse?

I've combined the USB and USB details examples into a single project and altered it to connect to a PS3 controller, but I can't get any data (other than all zeroes) from it

The relevant code is PrintRaf
 

Attachments

  • demo.zip
    11.3 KB · Views: 501
Last edited:
Top