.android.future.usb.UsbManager;

mUSBManager = UsbManager.getInstance(this);
UsbAccessory acc = mUSBManager.getAccessoryList()[0];

if (!mUSBManager.hasPermission(acc)) return;
</pre>

<p>The ADK 2012 app uses the support library to implement the USB accessory connections, in order to
support devices running Android 2.3.4 (API Level 10). If you only need to support Android
3.1 (API Level 12) and higher devices, you can replace the first 4 lines the following code:</p>

<pre>
import android.hardware.usb.UsbA