7

Does anyone know how to configure an Android device (tablet) to appear as a USB HID device when connected to a PC? Is there any other way of getting data from the tablet to the PC (via USB) other than writing it to a file, and have the PC retrieve the (updated) file from the tablet which is acting as a 'mass storage device' for the PC? Can USB carry a TCP/IP end-end connection? Using a tablet as a high-end intelligent 'keyboard' or 'mouse' or similar device would be immensely powerful, and open up lots of possibilities. Controlling a model railway layout is the end I have in mind. Thanks

radders
  • 923
  • 8
  • 29
  • 1
    This would also be a really cool way to use a Password Manager like KeePassDroid. You could just select an account, plug the phone in, and click: "input username" and "input password" – Frew Schmidt Nov 26 '12 at 14:03

3 Answers3

2

It's possible to do this using the linux gadget framework http://www.linux-usb.org/gadget/ using a custom composite USB device. The gadget framework is part of the Android kernel source tree by inheritance from Linux.

Unfortunately, Android has its own customizations that restrict the ability to dynamically register new USB gadgets so you will need to patch the kernel source tree for your particular device and add your HID gadget (otherwise you could create a module and load it that way) to the supported Android list.

I have done this before and will update this answer to contain more detail if there is interest. Unfortunately I lost the code so I will have to start from scratch.

insitusec
  • 191
  • 1
  • 5
  • I'm definitely interested; I'd love to be able to use my phone as a keystore device and as a touchpad with configurable buttons... – Michael Mol Oct 13 '13 at 16:16
  • Towards the end of this slideshow I describe how to do this: https://viaforensics.com/mobile-security/troopers-13-presentation-corporate-espionage-mobile-compromise.html I also talked about using this for password management on a mobile device here: http://www.youtube.com/watch?v=FRVkHlEKSv0 – insitusec Mar 14 '14 at 16:51
1

If I set up a web server on my phone and enable usb tethering, I can access that server from my PC. If that's not enough for you, this might help: https://market.android.com/details?id=usbwebcam.application&hl=en

I'm running cyanogenmod on a Desire CDMA (BravoC)

Let me know what you find out; it would be pretty handy to use my phone as a USB keyboard in the field. An android server with a PC client is gonna be easiest though.

-1

Have a look at Android Open Accessory Protocol 2.0. This could help you out.