質問

私は2.3.3から4.0のアップグレードテーブルを持っています。うまく機能しています。 さて、私はサンプルコードからADBテストアプリケーションをインストールしました。 しかし、それは何も示されていません。USBマウスまたはキーボードの企業とキーボードの作業を整理したがADBテストアプリケーションは何も表示しない場合のみ黒画面だけがあります。

タブレットに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