AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<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.DarkTheme)
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
'End of default text.
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" />)
CreateResource(xml, device_filter.xml,
<resources>
<usb-device vendor-id="1027" product-id="24577" />
</resources>
)
[Code]
[Code]
If (usb1.HasPermission(1)) Then ' Ver_2.4
Log(usb1.DeviceInfo(1))
'This is very important - ( VendorId, ProductId )
usb1.SetCustomDevice(usb1.DRIVER_FTDI, "1027","24577" )
Dim dev As Int
dev = usb1.Open(115200, 1)
If dev <> usb1.USB_NONE Then
Log("Connected successfully!!!! 1")
astreams1.Initialize(usb1.GetInputStream, usb1.GetOutputStream, "astreams1")
'This is important
usb1.SetParameters(115200, usb1.DATABITS_8,usb1.STOPBITS_1, usb1.PARITY_NONE)
'Here if you want code that call print
Else
Log("Error opening USB port 1!!!!!")
End If
Else
usb1.RequestPermission(1) ' Ver_2.4
End If
[Code]