SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
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

Más contenido relacionado

Más 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
 

Más 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

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
🐬 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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Último (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

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