in your manifest :
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<intent-filter>
<action android:name="b4a.gkc.weather.action.START" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/device_filter" />
in files/device_filter specify VID & PID
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-device vendor-id="6790" product-id="29987" />
</resources>