Does anyone have any experience with using the USB for io
<p>I am doing this for a hobby type device where I am using the Android as a cheap why to get GPS and other hardware services (since I already have the phone).  I have used an unofficial kernel called AdbWinUsb that disconnects the USB from its usual use and makes it into an io port.  Has anyone else out there done this before successfully?  I have code to write out to the serial port:
      import java.io.DataInputStream;
      import android.os.Bundle;
      import android.os.Messenger;</p>

<pre><code>  DataInputStream os;      
  process = Runtime.getRuntime().exec("su");
  os = new DataOutputStream(process.getOutputStream());
  os.writeBytes("chmod 777 /dev/ttyMSM0\n");
  ....
  String data = "echo \"Hello World\" &gt; /dev/ttyMSM0";
  os.writeBytes(data + "\n"); 
  os.flush(); 
</code></pre>

<p>and this works great. </p>

<p>Then in another thread, I need to set up the read, but I can't write to the port to set it up as I did in the output....</p>

<pre><code>    process = Runtime.getRuntime().exec("su");
    os = new DataInputStream(process.getInputStream());
    char xx = os.readChar();
</code></pre>

<p>The readChar doesn't work because it is not set up.  Is this correct?   So what do I do?</p>
