FTDI has a hardware bridge that plugs into the USB port. They provide an APK for it, but I want (need) to use b4a to 'read' GPIO pins (as in reading a 'joystick' to control action in the application) they also provide the Java source code.
I've purchased their UMFT311EV evaluation board, which will act as USB 2.0 HOST to the 'droid phone during the connection.
Does b4a library support this mode yet?
http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_UMFT311GP.pdf
BTW - I've donated (significantly) so far to NJDude and am still in a donating mood for useful answers.
a snippet of FTDI's source code: (the AndroidManifest.xml)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.GPIODemo"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="12" />
<uses-feature android:name="android.hardware.usb.accessory"/>
<application android:icon="@drawable/icon" android:label="@string/app_name" >
<activity android:name=".GPIODemoActivity"
android:label="@string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"/>
</intent-filter>
<meta-data
android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
android:resource="@xml/accessory_filter">
</meta-data>
</activity>
</application>
</manifest>