SlideShare uma empresa Scribd logo
1 de 13
Baixar para ler offline
3.1

 Joysticks and Gamepads
                 (@v vakame)

                               Android

                appengine


2011   7   17
HID



2011   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

                           @vvakame




2011   7   17
USB Host
                •           Android Device

                    •

                •       Android   Host

                    •

                    • LED

                                              …
                                    Android

2011   7   17
API


                ADK




2011   7   17
• UsbManager
                •   UsbManager      UsbDevice
                •   UsbDevice      UsbInterface
                •   UsbInterface    UsbEndpoint

                • UsbEndpoint

                • UsbDeviceConnection
                                      AndroidManifest
                                    USB                 Intent

2011   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);




                                                                            Web


2011   7   17
http://amzn.to/glitterpanel


2011   7   17

Mais conteúdo relacionado

Mais de Masahiro Wakame

GoCon 2015 Summer GoのASTをいじくって新しいツールを作る
GoCon 2015 Summer GoのASTをいじくって新しいツールを作るGoCon 2015 Summer GoのASTをいじくって新しいツールを作る
GoCon 2015 Summer GoのASTをいじくって新しいツールを作るMasahiro Wakame
 
ng-japan 2015 TypeScript+AngularJS 1.3
ng-japan 2015 TypeScript+AngularJS 1.3ng-japan 2015 TypeScript+AngularJS 1.3
ng-japan 2015 TypeScript+AngularJS 1.3Masahiro Wakame
 
TypeScriptは明日から使うべき
TypeScriptは明日から使うべきTypeScriptは明日から使うべき
TypeScriptは明日から使うべきMasahiro Wakame
 
TypeScript 型定義ファイルのある開発 TypeScript勉強会 VSハッカソン倶楽部
TypeScript 型定義ファイルのある開発 TypeScript勉強会 VSハッカソン倶楽部TypeScript 型定義ファイルのある開発 TypeScript勉強会 VSハッカソン倶楽部
TypeScript 型定義ファイルのある開発 TypeScript勉強会 VSハッカソン倶楽部Masahiro Wakame
 
Google Glassでできること XE12版 最新開発情報 Mirror API & GDK
Google Glassでできること XE12版 最新開発情報 Mirror API & GDKGoogle Glassでできること XE12版 最新開発情報 Mirror API & GDK
Google Glassでできること XE12版 最新開発情報 Mirror API & GDKMasahiro Wakame
 
コンパイラ指向ReVIEW
コンパイラ指向ReVIEWコンパイラ指向ReVIEW
コンパイラ指向ReVIEWMasahiro Wakame
 
20ヶ月を取り戻す Dart flight school
20ヶ月を取り戻す Dart flight school20ヶ月を取り戻す Dart flight school
20ヶ月を取り戻す Dart flight schoolMasahiro Wakame
 
Google Glassでできること XE11版 最新開発情報 Mirror API & GDK
Google Glassでできること XE11版 最新開発情報 Mirror API & GDKGoogle Glassでできること XE11版 最新開発情報 Mirror API & GDK
Google Glassでできること XE11版 最新開発情報 Mirror API & GDKMasahiro Wakame
 
CEATEC Glassware(Google Glassアプリ)開発の指南と開発事例
CEATEC Glassware(Google Glassアプリ)開発の指南と開発事例CEATEC Glassware(Google Glassアプリ)開発の指南と開発事例
CEATEC Glassware(Google Glassアプリ)開発の指南と開発事例Masahiro Wakame
 
ReVIEW & CI - ChefでCI環境構築
ReVIEW & CI - ChefでCI環境構築ReVIEW & CI - ChefでCI環境構築
ReVIEW & CI - ChefでCI環境構築Masahiro Wakame
 
Firefox OS勉強会 2nd TypeScript+AngularJS
Firefox OS勉強会 2nd TypeScript+AngularJSFirefox OS勉強会 2nd TypeScript+AngularJS
Firefox OS勉強会 2nd TypeScript+AngularJSMasahiro Wakame
 
AngularJS+TypeScript - AngularJS 1周年記念勉強会
AngularJS+TypeScript - AngularJS 1周年記念勉強会AngularJS+TypeScript - AngularJS 1周年記念勉強会
AngularJS+TypeScript - AngularJS 1周年記念勉強会Masahiro Wakame
 
Buildinsider OFFLINE TypeScriptの基礎から実践・利用事例まで
Buildinsider OFFLINE TypeScriptの基礎から実践・利用事例までBuildinsider OFFLINE TypeScriptの基礎から実践・利用事例まで
Buildinsider OFFLINE TypeScriptの基礎から実践・利用事例までMasahiro Wakame
 
俺とお前とGoogleware
俺とお前とGoogleware俺とお前とGoogleware
俺とお前とGooglewareMasahiro Wakame
 
Datastoreへのアクセスを楽してMemcacheアクセスに置き換えるライブラリ作った
Datastoreへのアクセスを楽してMemcacheアクセスに置き換えるライブラリ作ったDatastoreへのアクセスを楽してMemcacheアクセスに置き換えるライブラリ作った
Datastoreへのアクセスを楽してMemcacheアクセスに置き換えるライブラリ作ったMasahiro Wakame
 

Mais de Masahiro Wakame (20)

GoCon 2015 Summer GoのASTをいじくって新しいツールを作る
GoCon 2015 Summer GoのASTをいじくって新しいツールを作るGoCon 2015 Summer GoのASTをいじくって新しいツールを作る
GoCon 2015 Summer GoのASTをいじくって新しいツールを作る
 
ng-japan 2015 TypeScript+AngularJS 1.3
ng-japan 2015 TypeScript+AngularJS 1.3ng-japan 2015 TypeScript+AngularJS 1.3
ng-japan 2015 TypeScript+AngularJS 1.3
 
TypeScriptは明日から使うべき
TypeScriptは明日から使うべきTypeScriptは明日から使うべき
TypeScriptは明日から使うべき
 
TypeScript 型定義ファイルのある開発 TypeScript勉強会 VSハッカソン倶楽部
TypeScript 型定義ファイルのある開発 TypeScript勉強会 VSハッカソン倶楽部TypeScript 型定義ファイルのある開発 TypeScript勉強会 VSハッカソン倶楽部
TypeScript 型定義ファイルのある開発 TypeScript勉強会 VSハッカソン倶楽部
 
Google Glass XE17版
Google Glass XE17版Google Glass XE17版
Google Glass XE17版
 
Google Glassでできること XE12版 最新開発情報 Mirror API & GDK
Google Glassでできること XE12版 最新開発情報 Mirror API & GDKGoogle Glassでできること XE12版 最新開発情報 Mirror API & GDK
Google Glassでできること XE12版 最新開発情報 Mirror API & GDK
 
コンパイラ指向ReVIEW
コンパイラ指向ReVIEWコンパイラ指向ReVIEW
コンパイラ指向ReVIEW
 
20ヶ月を取り戻す Dart flight school
20ヶ月を取り戻す Dart flight school20ヶ月を取り戻す Dart flight school
20ヶ月を取り戻す Dart flight school
 
TypeScript 独習会
TypeScript 独習会TypeScript 独習会
TypeScript 独習会
 
Google Glassでできること XE11版 最新開発情報 Mirror API & GDK
Google Glassでできること XE11版 最新開発情報 Mirror API & GDKGoogle Glassでできること XE11版 最新開発情報 Mirror API & GDK
Google Glassでできること XE11版 最新開発情報 Mirror API & GDK
 
CEATEC Glassware(Google Glassアプリ)開発の指南と開発事例
CEATEC Glassware(Google Glassアプリ)開発の指南と開発事例CEATEC Glassware(Google Glassアプリ)開発の指南と開発事例
CEATEC Glassware(Google Glassアプリ)開発の指南と開発事例
 
ReVIEW & CI - ChefでCI環境構築
ReVIEW & CI - ChefでCI環境構築ReVIEW & CI - ChefでCI環境構築
ReVIEW & CI - ChefでCI環境構築
 
Firefox OS勉強会 2nd TypeScript+AngularJS
Firefox OS勉強会 2nd TypeScript+AngularJSFirefox OS勉強会 2nd TypeScript+AngularJS
Firefox OS勉強会 2nd TypeScript+AngularJS
 
AngularJS+TypeScript - AngularJS 1周年記念勉強会
AngularJS+TypeScript - AngularJS 1周年記念勉強会AngularJS+TypeScript - AngularJS 1周年記念勉強会
AngularJS+TypeScript - AngularJS 1周年記念勉強会
 
Buildinsider OFFLINE TypeScriptの基礎から実践・利用事例まで
Buildinsider OFFLINE TypeScriptの基礎から実践・利用事例までBuildinsider OFFLINE TypeScriptの基礎から実践・利用事例まで
Buildinsider OFFLINE TypeScriptの基礎から実践・利用事例まで
 
俺とお前とGoogleware
俺とお前とGoogleware俺とお前とGoogleware
俺とお前とGoogleware
 
Datastoreへのアクセスを楽してMemcacheアクセスに置き換えるライブラリ作った
Datastoreへのアクセスを楽してMemcacheアクセスに置き換えるライブラリ作ったDatastoreへのアクセスを楽してMemcacheアクセスに置き換えるライブラリ作った
Datastoreへのアクセスを楽してMemcacheアクセスに置き換えるライブラリ作った
 
TypeScript 勉強会
TypeScript 勉強会TypeScript 勉強会
TypeScript 勉強会
 
TypeScript Hands-on
TypeScript Hands-onTypeScript Hands-on
TypeScript Hands-on
 
わかめモナ化LT
わかめモナ化LTわかめモナ化LT
わかめモナ化LT
 

Último

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Último (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

ABC2011 Summer デ部 Joysticks and Gamepads, USB Host

  • 1. 3.1 Joysticks and Gamepads (@v vakame) Android appengine 2011 7 17
  • 2. HID 2011 7 17
  • 3. Joystick Gamepad ... 2011 7 17
  • 4. ↑↑ 2011 7 17
  • 5. • Activity GenericMotionEvent • on dispatch • KeyEvent • GenericMotionEvent • MotionEvent#getHistoricalXXX USB Keyboard Mouse ↑↑ 2011 7 17
  • 6. 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
  • 7. 3.1 USB Host @vvakame 2011 7 17
  • 8. USB Host • Android Device • • Android Host • • LED … Android 2011 7 17
  • 9. API ADK 2011 7 17
  • 10. • UsbManager • UsbManager UsbDevice • UsbDevice UsbInterface • UsbInterface UsbEndpoint • UsbEndpoint • UsbDeviceConnection AndroidManifest USB Intent 2011 7 17
  • 11. 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
  • 12. 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); Web 2011 7 17