Android Question Need advice with usb device

microbox

Active Member
Licensed User
Longtime User
Hi everyone! I'm working with a simple app using Prolific PL2303 and arduino..I'm using USB library 2.3 from agraham. I'm using Odroid U3 device with 4.0.4, ...works well but I noticed that every time I reboot the android device..it keeps asking (the default usb device I'll be using for the program). In my application, the user need not to click anything but have the arduino side have access(to buttons) the functions on my android app. Hope there is a solution for it.

Thanks in advance and more power!
 

microbox

Active Member
Licensed User
Longtime User
I read from another thread that it need to edit the xml file with the corresponding vendor-id and product-id..below is what I tried.
B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <usb-device vendor-id="1060" product-id="38704" />
</resources>
but unfortunately no luck.
 
Upvote 0

microbox

Active Member
Licensed User
Longtime User
wow I got it working..I comment the part
B4X:
If (usb.HasPermission) Then
else
usb.RequestPermission
End If
and just issue the usb.open
 
Upvote 0

microbox

Active Member
Licensed User
Longtime User
A proper way to create that If...then should be like this:
B4X:
If usb.HasPermission = False then
   usb.RequestPermission
End If
Hi NJDude...thank you very much for the time replying.

Kind regards,
microbox
 
Upvote 0

TheMightySwe

Active Member
Licensed User
Longtime User
I read from another thread that it need to edit the xml file with the corresponding vendor-id and product-id..below is what I tried.
B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <usb-device vendor-id="1060" product-id="38704" />
</resources>
but unfortunately no luck.


Hi Microbox,

I have a device with the same vendor-id and product-id, do you have a code example or link how to connect to it properly, both input and output?

Regards,

//TMS
 
Upvote 0

microbox

Active Member
Licensed User
Longtime User
Hi TMS,
I'm not sure if this would work for you or this is what you want but I did a little that will connect a usb (FTDI) device (but it will work for PL2303 as well) to a cheap tab. UbsTest.png 20151120_060342.jpg 20151120_061114.jpg

Hope this help.

Kind regards,
microbox
 

Attachments

  • USBTest.zip
    9.7 KB · Views: 111
Upvote 0
Top