Hi great people!
I am in trouble to make USB Device configuration. My app is using a USB pinpad for payments just fine.
Howeve EACH TIME that I turn on/off the device it ask for permission to use again. Giving the permission even clicking the checkbox does not change this behavior.
I tried adding the manifest code but now I am getting the following error:
Manifest:
device_filter.xml
what is wrong ?
I am in trouble to make USB Device configuration. My app is using a USB pinpad for payments just fine.
Howeve EACH TIME that I turn on/off the device it ask for permission to use again. Giving the permission even clicking the checkbox does not change this behavior.
I tried adding the manifest code but now I am getting the following error:
B4X:
B4A Version: 10.60
Parsing code. (0.01s)
Java Version: 8
Building folders structure. (0.20s)
Compiling code. (0.12s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. (0.00s)
Compiling generated Java code. (9.59s)
Convert byte code - dex. (108.40s)
Packaging files. Error
fakeLogOpen(/dev/log_crash) failed
fakeLogOpen(/dev/log_security) failed
fakeLogOpen(/dev/log_security) failed
fakeLogOpen(/dev/log_security) failed
res\values\device_filter.xml:3: error: Found tag usb-device where item is expected
AAPT path: C:\Android\tools\..\build-tools\27.0.1\aapt.exe
Exit code:1*** Legacy debugger is deprecated. ***
It is recommended to switch to the default debugger (Tools - IDE Options).
Manifest:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
AddManifestText(<uses-feature android:name="android.hardware.usb.accessory"/>)
CreateResource(values, device_filter.xml,
<resources>
<usb-device vendor-id="1753" product-id="c902"/>
</resources>
)
AddApplicationText(
<activity android:name="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" />
</activity>
)
device_filter.xml
B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-device vendor-id="1753" product-id="c902"/>
</resources>
what is wrong ?
Last edited: