ABC2011 Summer デ部 Joysticks and Gamepads, USB Host
Upcoming SlideShare
Loading in...5
×
 

ABC2011 Summer デ部 Joysticks and Gamepads, USB Host

on

  • 6,750 views

 

Statistics

Views

Total Views
6,750
Views on SlideShare
3,437
Embed Views
3,313

Actions

Likes
4
Downloads
13
Comments
0

6 Embeds 3,313

http://d.hatena.ne.jp 3284
https://twitter.com 12
http://webcache.googleusercontent.com 11
https://www.google.co.jp 3
http://twitter.com 2
http://cache.yahoofs.jp 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    ABC2011 Summer デ部 Joysticks and Gamepads, USB Host ABC2011 Summer デ部 Joysticks and Gamepads, USB Host Presentation Transcript

    • 3.1 Joysticks and Gamepads (@v vakame) Android appengine2011 7 17
    • HID2011 7 17
    • Joystick Gamepad ...2011 7 17
    • ↑↑2011 7 17
    • • Activity GenericMotionEvent • on dispatch • KeyEvent • GenericMotionEvent • MotionEvent#getHistoricalXXX USB Keyboard Mouse ↑↑2011 7 17
    • public class MainActivity extends Activity { @Override public boolean dispatchGenericMotionEvent(MotionEvent event) { float x = event.getX(); float y = event.getY(); Log.d("Joysticks", "x=" + x + ", y=" + y); return super.dispatchGenericMotionEvent(event); } } ( )2011 7 17
    • 3.1 USB Host @vvakame2011 7 17
    • USB Host • Android Device • • Android Host • • LED … Android2011 7 17
    • API ADK2011 7 17
    • • UsbManager • UsbManager UsbDevice • UsbDevice UsbInterface • UsbInterface UsbEndpoint • UsbEndpoint • UsbDeviceConnection AndroidManifest USB Intent2011 7 17
    • AndroidManifest.xml <manifest ...> <application ...> <activity ...> ... <intent-filter> <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /> </intent-filter> <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" android:resource="@xml/device_filter" /> </activity> </application> <uses-sdk android:minSdkVersion="12" /> <uses-feature android:name="android.hardware.usb.host" /> </manifest> /res/xml/device_filter.xml <?xml version="1.0" encoding="utf-8"?> <resources> <usb-device vendor-id="3888" product-id="64" /> </resources>2011 7 17
    • UsbManager usbManager; UsbDevice usbDevice; { // usbManager = (UsbManager) getSystemService(Context.USB_SERVICE); usbDevice = usbManager.getDeviceList().get("/dev/hogehoge"); } { // // getIntent().getAction().equals(UsbManager.ACTION_USB_DEVICE_ATTACHED); usbDevice = (UsbDevice) getIntent().getParcelableExtra(UsbManager.EXTRA_DEVICE); } UsbInterface usbInterface = usbDevice.getInterface(0); UsbEndpoint usbEndpoint = usbInterface.getEndpoint(0); UsbDeviceConnection usbDeviceConnection = usbManager.openDevice(usbDevice); usbDeviceConnection.claimInterface(usbInterface, true); usbDeviceConnection.bulkTransfer(usbEndpoint, ..., 100, 1000); Web2011 7 17
    • http://amzn.to/glitterpanel2011 7 17