문제

2.3.3에서 4.0까지의 업그레이드 테이블이 있습니다.그것은 잘 작동합니다. 이제 샘플 코드에서 ADB 테스트 응용 프로그램을 설치했습니다. 그러나 그것은 아무것도 나타내지 않습니다.검은 색으로 만화면에아무것도표시되지않는USB 마우스또는keyboard.Mouse및 키보드작업잘하지만ADB테스트 응용 프로그램이attacttached때입니다.

어떻게 테스트 할 수 있습니까? Table에 USB 액세서리 API가 태블릿에 있습니까? 누구나 샘플 코드를 제공 할 수 있습니까?

고맙습니다.

도움이 되었습니까?

해결책

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.

다른 팁

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();
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top