Erel,
I followed the information from this tutorial do add the rights to the application, however I am using PL2303 library.
The problem is that it keeps asking for right to access the USB-Serial cable (prolific 2303)
This is my manifest file:
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="12"/>
<uses-permission android:name="android.permission.INTERNET" />
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddApplicationText(<activity android:name="anywheresoftware.b4a.objects.preferenceactivity"/>)
AddActivityText(main, <intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/device_filter" />)
'End of default text.
I have changed the device_filter.xml to add my device:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 0x0403 / 0x6001: FTDI FT232R UART -->
<usb-device vendor-id="1027" product-id="24577" />
<!-- 0x2341 / Arduino -->
<usb-device vendor-id="9025" />
<!-- 0x16C0 / 0x0483: Teensyduino -->
<usb-device vendor-id="5824" product-id="1155" />
<!-- 0x2303 / 0x067b: Prolific SerialUSB -->
<usb-device vendor-id="8963" product-id="1659" />
</resources>
After it gets the rights it access the usb with no problem, send and receive byte fine.
But after some time, like 30 minutes (i believe it is related to screen trying to sleep, besides it is configured to be always on when powered) if you try to use the USB again the program crashes, when it gets back as for rights again. So i believe it crashed because the rights were revoked.
What can I do, I have customer right now waiting for a solution with equipment stopped!!!
Eduardo Elias