How can I get the ADK DemoKit example working on a Google I/O Galaxy Tab 10.1?

后端 未结 4 1216
迷失自我
迷失自我 2020-12-16 07:05

I\'m trying to get the DemoKit example working on an ADK board. It seems like even with the 3.1 update the Galaxy Tab doesn\'t have everything it needs (or at least doesn\'t

相关标签:
4条回答
  • 2020-12-16 07:23

    I just got the new TouchWiz update and now the Arduino reads this back to the serial port:

    Device addressed... Requesting device descriptor.found possible device. swithcing to serial mode
    device supports protcol 1
    
    Device addressed... Requesting device descriptor.found android acessory device
    config desc
    interface desc
    inEp: 1
    outEp: 2
    

    This is looking much better. The Galaxy Tab asks to run DemoKit, I hit OK, and it force quits. This better than it was previously.

    I will update if I get it working fully.

    0 讨论(0)
  • 2020-12-16 07:23

    My Galaxy Tab 10.1 on Android 3.1 didn't have the accessories API as a backport as well. So I got the following exception as well:

    java.lang.NoClassDefFoundError: com.android.future.usb.UsbManager
    

    One way to bringing it to work on the Tab 10.1 with Android 3.1 is to use the regular accessory API. Not the backported version. You can set your DemoKit projects target SDK to the regular API level 12 (Android 3.1).

    In addition you have to change the code passages in the DemoKitActivity to get the UsbManager and the UsbAccesory to:

    UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
    UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);
    

    imports change to:

    import android.hardware.usb.UsbAccessory;
    import android.hardware.usb.UsbManager;
    

    The Android manifest can still contain the following entry but it is not required anymore:

    <uses-library android:name="com.android.future.usb.accessory" />
    
    0 讨论(0)
  • 2020-12-16 07:34

    Are you sure you are using the right build target? Instead of regular "Android 2.3.3" (level 10) or "Android 3.1" (level 12), you should use "Google APIs" targets. If you run "Android SDK and AVD Manager", you can find them under Available Packages > Third party add-ons > Google Inc > "Google APIs by Google Inc., Android API 10" (or 12).

    0 讨论(0)
  • 2020-12-16 07:39

    My apologies, accessory mode currently doesn't work with the Samsung Galaxy Tab 10.1. Samsung is aware of the issue and is working on resolving it. When the device does support accessory mode you should be able to use the com.android.future.usb.* APIs which will make it easier for you to write an app that works both with Android 3.1 and 2.3.4.

    0 讨论(0)
提交回复
热议问题