AN 233 Java D2xx For Android API User Manual - FTDI

Transcription

Future Technology Devices International Ltd.Java D2xx for Android API UserManualDocument Reference No.:FT 000796Version 1.0Issue Date: 2013-02-05This document provides the application programming interface (API) for the JavaD2xx for Android library.Future Technology Devices International Limited (FTDI)Unit 1,2 Seaward Place, Glasgow G41 1HH, United KingdomTel.: 44 (0) 141 429 2777 Fax: 44 (0) 141 429 2758E-Mail (Support): support1@ftdichip.com Web: http://www.ftdichip.comCopyright 2013Future Technology Devices International LimitedUse of FTDI devices in life support and/or safety applications is entirely at the user’s risk, and the user agrees todefend, indemnify and hold harmless FTDI from any and all damages, claims, suits or expense resulting from suchuse.

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 328Table of Contents1Preface . 61.1234Acronyms and Abbreviations. 6Introduction . 72.1Android Support . 72.2Prerequisites. 7D2xx Library Packages . 93.1Package com.ftdi.j2xx . 93.2Class Hierarchy . 10Methods on D2xxManager . 114.1createDeviceInfoList . 214.2getDeviceInfoList . 214.3getDeviceInfoListDetail: . 224.4getInstance. 224.5getLibraryVersion . 224.6setVIDPID . 234.7getVIDPID . 234.8isFtDevice . 244.9openByDescription with DriverParameters . 244.10 openByDescription without DriverParameters . 244.11 openByIndex with DriverParameters . 254.12 openByIndex without DriverParameters . 254.13 openByLocation with DriverParameters . 254.14 openByLocation without DriverParameters . 264.15 openBySerialNumber with DriverParameters . 264.16 openBySerialNumber without DriverParameters . 274.17 openByUSBDevice with DriverParameters . 274.18 openByUSBDevice without DriverParameters . 284.19 Sample . 295FieldsinD2xxManager Class . 305.1Data Bits byte . 305.2Stop Bits byte . 305.3Parity Bits byte . 305.4Flow Control Bits short . 30Copyright 2013Future Technology Devices International Limited1

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 3285.5Purge Flags byte . 305.6Modem StatusBits byte . 305.7Line Status Bits byte . 305.8Event Bits byte . 315.9Device Information List Flags byte . 315.10 Device Type int . 315.11 Bit Mode Bits byte . 325.12 Break On Bits int . 3267D2xxManager.FtDeviceListNode . 336.1Fields . 336.2Constructor . 35D2xxManager.D2xxException . 367.189Constructor . 36D2xxManager.DriverParameters . 378.1Constructor . 378.2Methods . 378.2.1getBufferNumber . 388.2.2setBufferNumber . 388.2.3getMaxTransferSize . 388.2.4setMaxTransferSize. 388.2.5getMaxBufferSize . 398.2.6setMaxBufferSize . 398.2.7getReadTimeout . 398.2.8setReadTimeout . 39FT Device . 409.1close . 439.2getDeviceInfo . 439.3getLineStatus . 439.4getModemStatus . 439.5getQueueStatus . 459.6isOpen. 459.7purge . 459.8read with three parameters . 469.9read with two parameters . 469.10 Read with one parameter . 46Copyright 2013Future Technology Devices International Limited2

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 3289.11 readBufferFull . 479.12 write with two parameters. 479.13 write with three parameters . 479.14 write with one parameter . 489.15 resetDevice . 489.16 restartInTask . 489.17 stopInTask . 489.18 stoppedInTask . 499.19 setBaudrate . 499.20 setBitMode . 499.21 getBitMode. 509.22 setBreakOff . 509.23 setBreakOn . 519.24 setChar . 519.25 setDataCharacteristics . 519.26 setEventNotifcation . 529.27 getEventStatus . 529.28 setFlowControl . 539.29 setLatencyTimer . 539.30 getLatencyTimer . 539.31 setDtr. 549.32 clrDtr . 549.33 setRts . 549.34 clrRts . 549.35 eepromErase . 559.36 eepromRead . 559.37 eepromWrite . 569.38 eepromReadWord . 569.39 eepromWriteWord . 569.40 eepromGetUserAreaSize . 579.41 eepromReadUserArea . 579.42 eepromWriteUserArea . 5710 EEPROM Information . 5810.1 Class FT EEPROM. 58Copyright 2013Future Technology Devices International Limited3

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 32810.1.1Constructor. 5810.1.2Fields . 5810.2 Class FT EEPROM 232R . 6010.2.1Constructor. 6010.2.2Fields . 6010.2.3Nested Class . 6310.2.4CBUS Fields . 6310.3 Class FT EEPROM 245R . 6410.3.1Constructor. 6410.3.2Fields . 6410.3.3Nested Class . 6710.3.4CBUS Fields . 6710.4 Class FT EEPROM 2232D . 6810.4.1Constructor. 6810.4.2Fields . 6810.5 Class FT EEPROM 2232H . 7010.5.1Constructor. 7010.5.2Fields . 7010.5.3Nested Class . 7410.5.4Driver Length Fields . 7410.6 Class FT EEPROM 4232H . 7510.6.1Constructor. 7510.6.2Fields . 7510.6.3Nested Class . 7910.6.4Driver Length Fields . 7910.7 Class FT EEPROM 232H . 8010.7.1Constructor. 8010.7.2Fields . 8010.7.3Nested Class – Driver Strength . 8410.7.4Driver Length Fields . 8410.7.5Nested Class – CBBUS . 8410.7.6CBUS Fields . 8510.8 Class FT EEPROM X Series . 8610.8.1Constructor. 8610.8.2Fields . 8610.8.3Nested Class – Driver Strength . 9110.8.4Driver Length Fields . 9110.8.5Nested Class – CBUS . 91Copyright 2013Future Technology Devices International Limited4

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 32810.8.6CBUS Fields . 9211 Appendix A – References. 9312 Appendix B – List of figures . 9413 Appendix C – Revision History. 9514 Contact Information . 96Copyright 2013Future Technology Devices International Limited5

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 3281PrefaceThe D2xx interface is a proprietary interface specifically for FTDI devices. This document provides anexplanation of the functions available to application developers via the D2xx library.The software code examples used in the examples in this manual are not guaranteed nor are theysupported by FTDI.1.1 Acronyms and AbbreviationsTermsDescriptionD2xxFTDI’s proprietary “direct” user space driver interface running ontop of Android USB Host APIOSOperating SystemUSBUniversal Serial BusBSPBoard Supporting PackageWORD16 bits dataBreakA signal in the UART protocolAPIApplication Programming InterfaceOTGOn The GoSDKSoftware Development KitADTAndroid Development ToolsIDEIntegrated Development EnvironmentADBAndroid Debug BridgeEEPROMElectrically Erasable Programmable Read Only MemoryCBUSCBUS GPIO PinWiFiWireless FidelityLANLocal Area NetworkMCUMicrocontroller tocol Synchronous Serial EngineFIFOFirst In First OutCTSClear To SendRTSRequest To SendCopyright 2013Future Technology Devices International Limited6

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 3282 IntroductionFTDI provides a proprietary Android D2xx library for easy communication with its FTxxxx devices. TheD2xx API is an Android operating system library supported by FTDI.2.1 Android SupportThe API listed in this document is a D2xx solution to application scenarios supporting the Google AndroidOS.A Java class library supporting USB Host is available and applicable to Android v3.2 or any later series.This library requires no special root access privileges.2.2 PrerequisitesThe following is required to install the FTDI D2xx driver: An Android device(recommended),oA BSP supporting Android USB Host API corresponding to AOSP 3.2 or lateroA contemporary Android device running v3.2 or a later OS, with USB Host or OTGinterface. FTDI testing was conducted using a Google Nexus 7.An FTDI chip based module to test the FTDI D2xx driver:NOTE:To develop an application using the FTDI D2xx driver for Android, the development machine must havethe Eclipse IDE and an up-to-date version of Android SDK, including the ADB program and Android ADTPlugin installed. The installation and configuration of these tools is not included in this document. Formore information, please see right 2013Future Technology Devices International Limited7

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 328The Android device should also have USB Debugging enabled to allow access using the ADB utility. Toaccomplish this, navigate to Settings Applications Development and check the USB debuggingoption. A summary of the required configuration is provided in the diagram below.Development MachineEclipse IDE with ADT PluginAndroid SDKAndroid ADB UtilityAndroid DeviceADBConnectionover USBUSB Host CapabilityUSB Debugging EnabledWi-Fi/LAN EnabledFigure 1: Android Development ConfigurationCopyright 2013Future Technology Devices International Limited8

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 3283 D2xx Library Packages3.1 Package com.ftdi.j2xxClass SummaryClassDescriptionD2xxManagerA management class for connected FTDI devices.D2xxManager.DriverParametersA class for read() tion about a connected FTDI device.FT DeviceA device class providing different APIs for a host tocommunicate and operate different FT devices.FT EEPROMEEPROM data structure of the 232A, 232BFT EEPROM 2232DEEPROM data structure on the 2232DFT EEPROM 2232HEEPROM data structure on the 2232HFT EEPROM 2232H.DRIVE STRENGTHThe driver strength of the 2232HFT EEPROM 232HEEPROM data structure on the 232HFT EEPROM 232H.CBUSCBus Option of the FT232HFT EEPROM 232H.DRIVE STRENGTHThe driver strength on the 232HFT EEPROM 232REEPROM data structure on the 232RFT EEPROM 232R.CBUSCBus Option on the FT232RFT EEPROM 245REEPROM data structure on the 245RFT EEPROM 245R.CBUSCBus Option on the FT245HFT EEPROM 4232HEEPROM data structure on the 4232HFT EEPROM 4232H.DRIVE STRENGTHThe driver strength on the FT4232HFT EEPROM X SeriesEEPROM data structure on the X SeriesFT EEPROM X Series.CBUSCBus Option on the X SeriesFT EEPROM X Series.DRIVE STRENGTH The driver strength on the X SeriesException on A class for exception debug Handle exception and print error messageCopyright 2013Future Technology Devices International Limited9

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 3283.2 Class Hierarchyojava.lang.Objecto com.ftdi.j2xx.D2xxManagero com.ftdi.j2xx.D2xxManager.DriverParameterso com.ftdi.j2xx.D2xxManager.FtDeviceInfoListNodeo com.ftdi.j2xx.FT Deviceo com.ftdi.j2xx.FT EEPROMo com.ftdi.j2xx.FT EEPROM 2232Do com.ftdi.j2xx.FT EEPROM 2232Ho com.ftdi.j2xx.FT EEPROM 232Ho com.ftdi.j2xx.FT EEPROM 232Ro com.ftdi.j2xx.FT EEPROM 245Ro com.ftdi.j2xx.FT EEPROM 4232Ho com.ftdi.j2xx.FT EEPROM X Serieso com.ftdi.j2xx.FT EEPROM 2232H.DRIVE STRENGTHo com.ftdi.j2xx.FT EEPROM 232H.CBUSo com.ftdi.j2xx.FT EEPROM 232H.DRIVE STRENGTHo com.ftdi.j2xx.FT EEPROM 232R.CBUSo com.ftdi.j2xx.FT EEPROM 245R.CBUSo com.ftdi.j2xx.FT EEPROM 4232H.DRIVE STRENGTHo com.ftdi.j2xx.FT EEPROM X Series.CBUSo com.ftdi.j2xx.FT EEPROM X Series.DRIVE STRENGTHo java.lang.Throwable (implements java.io.Serializable)o java.lang.Exceptiono java.io.IOExceptiono com.ftdi.j2xx.D2xxManager.D2xxExceptionCopyright 2013Future Technology Devices International Limited10

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 3284 Methods on D2xxManagerA management class for connected FTDI devices. Use “getInstance()” to get a copy of D2xxManager;use ”createDeviceInfoList()” method to scan current connected FTDI devices, then open target device viaa suitable open API.The functions listed in this section are used to manage FT devices.Field SummaryFieldsModifier and TypeField and Descriptionstatic byteFT BILine status bits :OE: FT OE,PE: FT PE,FE: FT FE,BI: FT BIstatic byteFT BITMODE ASYNC BITBANGBit Mode bits :Reset: FT BITMODE RESET,Asynchronous Bit Bang: FT BITMODE ASYNC BITBANG,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT BITMODE MPSSE,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232Hdevices only) : FT BITMODE SYNC BITBANG,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE MCU HOST,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE FAST SERIAL,CBUS Bit Bang Mode (FT232R and FT232H devices only) :FT BITMODE CBUS BITBANG,Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) :FT BITMODE SYNC FIFOstatic byteFT BITMODE CBUS BITBANGBit Mode bits :Reset: FT BITMODE RESET,Asynchronous Bit Bang: FT BITMODE ASYNC BITBANG,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT BITMODE MPSSE,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232Hdevices only) : FT BITMODE SYNC BITBANG,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE MCU HOST,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE FAST SERIAL,CBUS Bit Bang Mode (FT232R and FT232H devices only) :FT BITMODE CBUS BITBANG,Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) :FT BITMODE SYNC FIFOstatic byteFT BITMODE FAST SERIALBit Mode bits :Reset: FT BITMODE RESET,Copyright 2013Future Technology Devices International Limited11

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 328Asynchronous Bit Bang: FT BITMODE ASYNC BITBANG,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT BITMODE MPSSE,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232Hdevices only) : FT BITMODE SYNC BITBANG,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE MCU HOST,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE FAST SERIAL,CBUS Bit Bang Mode (FT232R and FT232H devices only) :FT BITMODE CBUS BITBANG,Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) :FT BITMODE SYNC FIFOstatic byteFT BITMODE MCU HOSTBit Mode bits :Reset: FT BITMODE RESET,Asynchronous Bit Bang: FT BITMODE ASYNC BITBANG,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT BITMODE MPSSE,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232Hdevices only) : FT BITMODE SYNC BITBANG,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE MCU HOST,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE FAST SERIAL,CBUS Bit Bang Mode (FT232R and FT232H devices only) :FT BITMODE CBUS BITBANG,Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) :FT BITMODE SYNC FIFOstatic byteFT BITMODE MPSSEBit Mode bits :Reset: FT BITMODE RESET,Asynchronous Bit Bang: FT BITMODE ASYNC BITBANG,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT BITMODE MPSSE,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232Hdevices only) : FT BITMODE SYNC BITBANG,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE MCU HOST,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE FAST SERIAL,CBUS Bit Bang Mode (FT232R and FT232H devices only) :FT BITMODE CBUS BITBANG,Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) :FT BITMODE SYNC FIFOstatic byteFT BITMODE RESETBit Mode bits :Reset: FT BITMODE RESET,Asynchronous Bit Bang: FT BITMODE ASYNC BITBANG,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT BITMODE MPSSE,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232Hdevices only) : FT BITMODE SYNC BITBANG,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE MCU HOST,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE FAST SERIAL,CBUS Bit Bang Mode (FT232R and FT232H devices only) :Copyright 2013Future Technology Devices International Limited12

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 328FT BITMODE CBUS BITBANG,Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) :FT BITMODE SYNC FIFOstatic byteFT BITMODE SYNC BITBANGBit Mode bits :Reset: FT BITMODE RESET,Asynchronous Bit Bang: FT BITMODE ASYNC BITBANG,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT BITMODE MPSSE,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232Hdevices only) : FT BITMODE SYNC BITBANG,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE MCU HOST,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE FAST SERIAL,CBUS Bit Bang Mode (FT232R and FT232H devices only) :FT BITMODE CBUS BITBANG,Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) :FT BITMODE SYNC FIFOstatic byteFT BITMODE SYNC FIFOBit Mode bits :Reset: FT BITMODE RESET,Asynchronous Bit Bang: FT BITMODE ASYNC BITBANG,MPSSE (FT2232, FT2232H, FT4232H and FT232H devices only) : FT BITMODE MPSSE,Synchronous Bit Bang (FT232R, FT245R, FT2232, FT2232H, FT4232H and FT232Hdevices only) : FT BITMODE SYNC BITBANG,MCU Host Bus Emulation Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE MCU HOST,Fast Opto-Isolated Serial Mode (FT2232, FT2232H, FT4232H and FT232H devices only) :FT BITMODE FAST SERIAL,CBUS Bit Bang Mode (FT232R and FT232H devices only) :FT BITMODE CBUS BITBANG,Single Channel Synchronous 245 FIFO Mode (FT2232H and FT232H devices only) :FT BITMODE SYNC FIFOstatic byteFT CTSModem status bits :CTS: FT CTS,DSR: FT DSR,RI: FT RI,DCD: FT DCDstatic byteFT DATA BITS 7Data bits :7 : FT DATA BITS 7,8 : FT DATA BITS 8static byteFT DATA BITS 8Data bits :7 : FT DATA BITS 7,8 : FT DATA BITS 8static byteFT DCDModem status bits :CTS: FT CTS,DSR: FT DSR,Copyright 2013Future Technology Devices International Limited13

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance No.:FTDI# 328RI: FT RI,DCD: FT DCDstatic intFT DEVICE 2232Device Type :bvdDevice 0x0200 or 0x0400 and iSerialNumber ! 0: FT DEVICE 232B,bvdDevice 0x0200 and iSerialNumber ! 0 : FT DEVICE 8U232AM,Unknown : FT DEVICE UNKNOWN,bvdDevice 0x0500 : FT DEVICE 2232,bvdDevice 0x0600 : FT DEVICE 232R,bvdDevice 0x0600 : FT DEVICE 245R,bvdDevice 0x0700 : FT DEVICE 2232H,bvdDevice 0x0800 : FT DEVICE 4232H,bvdDevice 0x0900 : FT DEVICE 232H,bvdDevice 0x1000 : FT DEVICE X SERIESstatic intFT DEVICE 2232HDevice Type :bvdDevice 0x0200 or 0x0400 and iSerialNumber ! 0: FT DEVICE 232B,bvdDevice 0x0200 and iSerialNumber ! 0 : FT DEVICE 8U232AM,Unknown : FT DEVICE UNKNOWN,bvdDevice 0x0500 : FT DEVICE 2232,bvdDevice 0x0600 : FT DEVICE 232R,bvdDevice 0x0600 : FT DEVICE 245R,bvdDevice 0x0700 : FT DEVICE 2232H,bvdDevice 0x0800 : FT DEVICE 4232H,bvdDevice 0x0900 : FT DEVICE 232H,bvdDevice 0x1000 : FT DEVICE X SERIESstatic intFT DEVICE 232BDevice Type :bvdDevice 0x0200 or 0x0400 and iSerialNumber ! 0: FT DEVICE 232B,bvdDevice 0x0200 and iSerialNumber ! 0 : FT DEVICE 8U232AM,Unknown : FT DEVICE UNKNOWN,bvdDevice 0x0500 : FT DEVICE 2232,bvdDevice 0x0600 : FT DEVICE 232R,bvdDevice 0x0600 : FT DEVICE 245R,bvdDevice 0x0700 : FT DEVICE 2232H,bvdDevice 0x0800 : FT DEVICE 4232H,bvdDevice 0x0900 : FT DEVICE 232H,bvdDevice 0x1000 : FT DEVICE X SERIESstatic intFT DEVICE 232HDevice Type :bvdDevice 0x0200 or 0x0400 and iSerialNumber ! 0: FT DEVICE 232B,bvdDevice 0x0200 and iSerialNumber ! 0 : FT DEVICE 8U232AM,Unknown : FT DEVICE UNKNOWN,bvdDevice 0x0500 : FT DEVICE 2232,bvdDevice 0x0600 : FT DEVICE 232R,bvdDevice 0x0600 : FT DEVICE 245R,bvdDevice 0x0700 : FT DEVICE 2232H,bvdDevice 0x0800 : FT DEVICE 4232H,Copyright 2013Future Technology Devices International Limited14

Java D2xx for Android API User ManualVersion: 1.0Document Reference No.FT 000796Clearance

D2xx API is an Android operating system library supported by FTDI. 2.1 Android Support The API listed in this document is a D2xx solution to application scenarios supporting the Google Android OS. A Java class library supporting USB Host is available and applicable to Android v3.2 or any later series.