Question

I have upgrade table from 2.3.3 to 4.0. It is working fine. Now, I have installed ADB test application from sample code. But it doesn't show anything. only black screen is there when I attacttached usb mouse or keyboard.Mouse and Keyboard working fine but ADB test application don't show anything.

How can I test that is there USB Accessory APi is there in tablet? Can anyone provide sample code for that?

Thank You.

Was it helpful?

Solution

Upgrading the Android device from 2.3.3 to 4.0 may not enough to make sure that it will support accessory mode required by ADK. Check the kernel version of the ROM. If it below 2.6.., then most probably it does not support the accessory mode.

OTHER TIPS

Try this, taken from http://developer.android.com/guide/topics/usb/accessory.html

UsbAccessory mAccessory;
ParcelFileDescriptor mFileDescriptor;
FileInputStream mInputStream;
FileOutputStream mOutputStream;

...

private void openAccessory() {
    Log.d(TAG, "openAccessory: " + accessory);
    mFileDescriptor = mUsbManager.openAccessory(mAccessory);
    if (mFileDescriptor != null) {
        FileDescriptor fd = mFileDescriptor.getFileDescriptor();
        mInputStream = new FileInputStream(fd);
        mOutputStream = new FileOutputStream(fd);
        Thread thread = new Thread(null, this, "AccessoryThread");
        thread.start();
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top