title: Arduino + Android USB Host API = faulty packages
body: <p>I'm trying to interact with my <a href="http://arduino.cc/en/Main/ArduinoBoardUno" rel="nofollow">Arduino Uno</a> from my Android tablet running 4.0.3 and got everything working using the Android USB Host API, which means I can send data over USB to the board and read it there via <code>Serial.read()</code> successfully. </p>
  
  <p>Now I'm trying to implement a feedback functionality, which means the other way around, sending from the Arduino Uno and reading on the tablet. This works also quite well using <code>Serial.write()</code>, but I got a little problem: Sometimes, there are no bytes transferred and some other times, only some of them, so the content I'm sending is cut in half. How do I fix this? </p>
  
  <p>I'm asssuming the Serial port has some issues sending all of the data. Should I perhaps change the baud-rate which is currently at 9600?</p>
  
  <p>Here's the code on the Android side:</p>
  
  <pre><code>byte[]data = new byte[1024]; //Bigger size just to make sure...
  int returnLen = conn.bulkTransfer(epIN,data,data.length,500); //epIN is the` 
  </code></pre>
  
  <p>On the Arduino side a simple </p>
  
  <pre><code>Serial.write(5);
  </code></pre>
  
  <p>is used.</p>