Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the ADK DemoKit example working on a Google I/O Galaxy Tab 10.1?

Tags:

android

adk

I'm trying to get the DemoKit example working on an ADK board. It seems like even with the 3.1 update the Galaxy Tab 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.

It won't run if I use the API Level 10 Libraries as instructed (stepping through the debugger I see this exception: java.lang.NoClassDefFoundError: com.android.future.usb.UsbManager). The same thing happens if I use the API Level 12 Libraries.

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 com.android.future.usb library). I found some documentation of some changes 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

37,38c37
< import com.android.future.usb.UsbAccessory;
< import com.android.future.usb.UsbManager;
---
> import android.hardware.usb.*;
128c127
< UsbAccessory accessory = UsbManager.getAccessory(intent);
---
> UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
139c138
< UsbAccessory accessory = UsbManager.getAccessory(intent);
---
> UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
152c151
< mUsbManager = UsbManager.getInstance(this);
---
> mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);

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 "Please connect a DemoKit board", 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 "Press the home key to quit Samsung Kies" 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.

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?

UPDATE

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):

Device addressed... Requesting device descriptor.

found possible device. swithcing to serial mode

Data packet error: 5could not read device protocol version

It repeats constantly while it's plugged in to the tablet.

UPDATE 2

I realized I didn't update the AndroidManifest.xml file... Changing:

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="11" />

to

<uses-sdk android:minSdkVersion="12" android:targetSdkVersion="12" />

and

<uses-library android:name="com.android.future.usb.accessory"/>

to

<uses-feature android:name="android.hardware.usb.accessory"/>

It didn't seem to change anything once I got that corrected.

UPDATE 3

I have emailed Samsung support and am awaiting a reply.

like image 604
John Avatar asked Jun 15 '11 08:06

John


2 Answers

My apologies, accessory mode currently doesn't work with the Samsung Galaxy Tab 10.1. Samsung is aware of the issue and is working on resolving it. When the device does support accessory mode you should be able to use the com.android.future.usb.* APIs which will make it easier for you to write an app that works both with Android 3.1 and 2.3.4.

like image 160
cyngus Avatar answered Sep 23 '22 20:09

cyngus


I just got the new TouchWiz update and now the Arduino reads this back to the serial port:

Device addressed... Requesting device descriptor.found possible device. swithcing to serial mode
device supports protcol 1

Device addressed... Requesting device descriptor.found android acessory device
config desc
interface desc
inEp: 1
outEp: 2

This is looking much better. The Galaxy Tab asks to run DemoKit, I hit OK, and it force quits. This better than it was previously.

I will update if I get it working fully.

like image 43
idreamincode Avatar answered Sep 25 '22 20:09

idreamincode