Sunday, May 15, 2011

ADK compiled for android 3.1

I got the ADK compiled for android 3.1. The way it is written is targeted at 3.0 with an additional library. The general instructions and ADK can be found here http://developer.android.com/guide/topics/usb/adk.html

First, remove line 10 () from the androidManifest.xml file. Now we must change DemoKitActivity.java.

The imports for USB must be changed from com.android.future.usb.... to android.hardware.usb....

In line 128 and 139 change:
UsbAccessory accessory = UsbManager.getAccessory(intent);
to:
UsbAccessory accessory =(UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);


Line 152 must go from:
mUsbManager = UsbManager.getInstance(this);
to:
mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);

Now I just have to wait for my USB host board to come in so that I can play with some stuff....

No comments: