title: How can I get the ADK DemoKit example working on a Google I/O Galaxy Tab 10.1?
body: <p>I'm trying to get the <a href="http://developer.android.com/guide/topics/usb/adk.html#getting-started" rel="nofollow noreferrer">DemoKit example</a> working on an ADK board. It seems like even with the 3.1 update the <a href="http://en.wikipedia.org/wiki/Samsung_Galaxy_Tab_10.1" rel="nofollow noreferrer">Galaxy Tab</a> doesn't have everything it needs (or at least doesn't work as advertised). And even with digging though the documentation it seems like the Samsung Kies app is possibly getting in the way.</p>
  <p>It won't run if I use the API Level 10 Libraries as instructed (stepping through the debugger I see this exception: <code>java.lang.NoClassDefFoundError: com.android.future.usb.UsbManager</code>). The same thing happens if I use the API Level 12 Libraries.</p>
  <p>Setting the target to be the 3.1 platform (simply changing it in the project properties) it won't compile (due to use of the <code>com.android.future.usb</code> library). I found some documentation of <a href="http://developer.android.com/guide/topics/usb/accessory.html#api" rel="nofollow noreferrer">some changes</a> that you have to do to use the USB package on 3.1 and from that, these are the changes I made to DemoKitActivity.java</p>
  <pre><code>37,38c37
  &lt; import com.android.future.usb.UsbAccessory;
  &lt; import com.android.future.usb.UsbManager;
  ---
  &gt; import android.hardware.usb.*;
  128c127
  &lt; UsbAccessory accessory = UsbManager.getAccessory(intent);
  ---
  &gt; UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
  139c138
  &lt; UsbAccessory accessory = UsbManager.getAccessory(intent);
  ---
  &gt; UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
  152c151
  &lt; mUsbManager = UsbManager.getInstance(this);
  ---
  &gt; mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
  </code></pre>
  <p>Even after making those changes I've been running into issues though. It installs now and the initial screen for the DemoKit app comes up with the &quot;Please connect a DemoKit board&quot;, but whenever I connect the ADK board and turn off USB debugging (with it on it, it does nothing), I just get the Samsung Kies app which says &quot;Press the home key to quit Samsung Kies&quot; and no other buttons respond. Hitting home and going back into the DemoKit app just shows the connect screen again and it never really connects to the board.</p>
  <p>How can this be made to work? Does the ADK work with the Galaxy Tab 10.1 (Google I/O edition) and if so, am I on the right track?</p>
  <h2>UPDATE</h2>
  <p>Here's what the Arduino serial monitor says regardless if debug mode is on or off on the tablet (need to set the baud rate to 115200 to read the output):</p>
  <blockquote>
  <p>Device addressed... Requesting device descriptor.</p>
  <p>found possible device. swithcing to serial mode</p>
  <p>Data packet error: 5could not read device protocol version</p>
  </blockquote>
  <p>It repeats constantly while it's plugged in to the tablet.</p>
  <h2>UPDATE 2</h2>
  <p>I realized I didn't update the <code>AndroidManifest.xml</code> file... Changing:</p>
  <pre><code>&lt;uses-sdk android:minSdkVersion=&quot;10&quot; android:targetSdkVersion=&quot;11&quot; /&gt;
  </code></pre>
  <p>to</p>
  <pre><code>&lt;uses-sdk android:minSdkVersion=&quot;12&quot; android:targetSdkVersion=&quot;12&quot; /&gt;
  </code></pre>
  <p>and</p>
  <pre><code>&lt;uses-library android:name=&quot;com.android.future.usb.accessory&quot;/&gt;
  </code></pre>
  <p>to</p>
  <pre><code>&lt;uses-feature android:name=&quot;android.hardware.usb.accessory&quot;/&gt;
  </code></pre>
  <p>It didn't seem to change anything once I got that corrected.</p>
  <h2>UPDATE 3</h2>
  <p>I have emailed Samsung support and am awaiting a reply.</p>