Reputation: 41
I heard that Android 3.0 sdk is having support for USB Host. I want to read / write data on USB port of Android device using android app. This app will send data to a sensor device connected to usb port of android tablet. Is there any sample code or example available for USB read write ?
Upvotes: 4
Views: 16191
Reputation: 1
If you plan to write commercial apps then forget about rooting. IOIO library allows you to write to USB port (see this link). Although designed to support IOIO board specifically, this lib can be used to send commands through USB.
Upvotes: 0
Reputation: 21
Try the MissleLauncher example at http://developer.android.com/resources/samples/USB/MissileLauncher/index.html.
Implements very simple async transfer of data. Clear, concise code.
Upvotes: 2
Reputation: 23787
solution:
1) get access to the USB port
http://atechyblog.blogspot.com/2010/09/reboot-persisting-all-user-access-usb.html
2) get programmatic access so that you can use API's from within Java
http://www.anddev.org/ndk-problems-f56/android-serial-port-usb-t52802.html
http://code.google.com/p/android-serialport-api/source/checkout
NOTE: you will need root access to make this happen
Upvotes: 0