Android Question delete device_filter.xml

Pesciolina

Active Member
Licensed User
Longtime User
lately during compilation it deletes the device_filter file, how can I solve this problem?

Thank you

Manifest:
AddActivityText(main, <intent-filter>
    <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
 <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
</intent-filter>
    <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
        android:resource="@xml/device_filter" />
        )

device_fiter:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- 0x0403 / 0x6001: FTDI FT232R UART -->
    <usb-device vendor-id="1027" product-id="24577" />
    
    <!-- 0x0403 / 0x6001: FTDI FT232R UART -->
    <usb-device vendor-id="1027" product-id="24597" />

    <!-- 0x2341 / Arduino -->
    <usb-device vendor-id="9025" />

    <!-- 0x16C0 / 0x0483: Teensyduino  -->
    <usb-device vendor-id="5824" product-id="1155" />
    
    <!-- MIT  -->
    <usb-device vendor-id="3146" product-id="1" />
    
    <!-- 0x067b / 0x2303 Prolific PL2303 -->
    <usb-device vendor-id="1659" product-id="8963"/>


</resources>

1716988383142.png
 
Solution
how can I solve this problem?
B4X:
CreateResource(values, device_filter.xml,
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-device vendor-id="1921" product-id="21891"/>
<usb-device vendor-id="3468" product-id="316"/>
<usb-device vendor-id="4292" product-id="60000"/>
</resources>
)
B4X:

In this scenario you don´t need to put a file readonly. Just add them like this in your manifest.

DonManfred

Expert
Licensed User
Longtime User
how can I solve this problem?
B4X:
CreateResource(values, device_filter.xml,
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-device vendor-id="1921" product-id="21891"/>
<usb-device vendor-id="3468" product-id="316"/>
<usb-device vendor-id="4292" product-id="60000"/>
</resources>
)
B4X:

In this scenario you don´t need to put a file readonly. Just add them like this in your manifest.
 
Upvote 1
Solution

Pesciolina

Active Member
Licensed User
Longtime User
1717076967648.png

Manifest:
AddActivityText(main, <intent-filter>
    <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
 <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
</intent-filtro>
    <meta-dati android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
        android:resource="@xml/device_filter" />
        ) 

CreateResource(values, device_filter.xml,
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <usb-device vendor-id="1027" product-id="24577" />
    <usb-device vendor-id="1027" product-id="24597" />
    <usb-device vendor-id="9025" />
    <usb-device vendor-id="5824" product-id="1155" />
    <usb-device vendor-id="3146" product-id="1" />
    <usb-device vendor-id="1659" product-id="8963"/>
    <usb-device vendor-id="1003" />
    <usb-device vendor-id="4292" product-id="60000"/>
    <usb-device vendor-id="1317" product-id="42151"/>
   
    <usb-device vendor-id="0x0c4a" product-id="0x889"/>
    <usb-device vendor-id="0x0c4a" product-id="0x88a"/> 
    <usb-device vendor-id="0x0c4a" product-id="0x88b"/> 
</resources>
)
[/CODICE]
 
Upvote 0
Top