Android 3.1 Devices Have USB Host Mode. Here’s How To Use It.

With the coming of Android 3.1 you finally have the option of using the device as a USB host. This may be through a USB OTG (On-the-Go) adaptor, but nonetheless it’s a feature which was sorely missed until now. [Manuel] put together a guide on using Android as a USB host. As you can see, his example hardware is an Arduino board but this is applicable with just about any device.

The tutorial implements a test app for the Android device where a slider will set the brightness of the Arduino’s on-board LED. The Arduino sketch is nothing special, it just reads data received on the UART. This means that it doesn’t care if it’s connected to an Android, PC, OSX, or Linux system, it goes about its business until the RX interrupt updates the data variable.

This will greatly simplify a lot of projects we’ve seen, such as this message scrolling belt buckle. That used extra hardware to make the Arduino the host, a step that is now necessary.

27 thoughts on “Android 3.1 Devices Have USB Host Mode. Here’s How To Use It.

  1. Just feel I need to point out, 2.x has had this for certain devices for a while now, my SGS2 for example has had it since the day it was released in the UK when I bought it.

    Nonetheless, it’s a useful feature to have :)

  2. If you have a tablet it is usually easier, and the Toshiba Thrive (and maybe some others) have a full size USB port, and accepts keyboards, mice, and game controllers directly.

    More things have been discovered by the people at:

    http://www.thriveforums.org

    Including a supported ethernet chip – yes, a hardwired network! And you can use either prolific or FTDI USB serial adapters with the Slick USB app. You can probably alter the USB call as in the arduino example to talk to nearly any USB serial chip.

    Unrooted the Thrive does exFAT, rooted it does NTFS and probably more.

  3. While this article isn’t inaccurate, we’ve had Android 3.1 for quite some time now. The tone here suggests this is a new development.

    I think Mike was trying to convey with this post that Android 3.1 and above support USB host, which includes the Galaxy Nexus running Android 4.0.

  4. I think the main thing here (correct me if I’m wrong) is that having a USB host port on earlier android devices is “normal” if not in the USofA. Americans always get the shaft. We can’t even get Benny Hill any more.

    1. No. Android phone handsets which support USB Host mode natively out of the box are few and far between internationally as well.

      Yes there are some devices which support it, but it has only been a native feature of Android since version 3.1. After 3.1 was released some manufacturers backported it to new firmwares.

  5. Really? HackADay, you realize that there’s already controversy over 5.x Jellybean right? and 4.0 just came out… and 3.x was the tablet-only closed source… Could you guys get an Android-educated editor on staff to prevent looking like this article was sitting around on wordpress since May 2011?

  6. As others have pointed out, this dates back to 1.0 even. Why? Cause it’s Linux on an Arm device. If your device doesn’t work it can probably be made to work with kernel building.

    1. Others would be wrong. Specific manufactures have coded a USB host feature in specific phones since Android 1.0. It has not been a standard feature of Android until recently.

      Also saying you can just build the kernel is wrong too. Android has about as much in common with the Linux kernel as a dolphin to a shark. They both swim in the see and that’s about it. Building a kernel for a phone is not even remotely a trivial exercise. Android may be open source but the version that ships with most phones is anything but, and filled with many proprietary drivers. Heck Android doesn’t even have open source drivers for CDMA telephony.

      And that’s without even looking at a system service to handle a USB device.

      1. Well, I’ve successfully run Debian off an Android kernel. That seems close enough to Linux for my liking. Sure, the environment is different (typically no GNU stuff), but it literally IS the Linux kernel.

        I also have an Archos 5 IT, which is Android 1.6 and supports USB host. It was released far before android 3.1. Sure, it wasn’t standard to have USB host pre 3.1, but people can and have built custom kernels and extensions for Android devices. So please, stop ranting about something you don’t know about, k? Thanks =)

      2. It’s worth noting I’ve done everything you’re assuming is “wrong” many times. You can easily build from repositories and blobs for any Android device..

        I *HAVE* seen some where it was hard to get baseband blobs, but once you have them you can build an image.

        Host mode has been there since 1.0, if any devices didn’t have it, it’s only because of kernel or driver options; mostly binary driver(blob) support in my experience..

  7. USB host capability is great to have for portable devices. I used my N800 ( with Debian) to burn dvd’s when I was travelling in far off places in 2009 and had filled up my sd cards. Used a usb keyboard a bit more often.

  8. I don’t understand why so many people here are like “this is old”, “I can hook up my mouse”, “I already did this with my custom built kernel” etc.

    Surely, USB host capability has been around for some Android devices, and with proper hacking ie. rooting, libusb porting, JNI-glue you can actually talk to USB devices from within your Android app.

    But this post is about Android 3.1+, where there is an USB Host API available. Maybe [Mike] didn’t stress that enough (although it says 3.1 in the title).

    This means that you can create your own Android app like always and use Java code to talk to USB devices. No hacking/rooting/losing your warranty etc. required. A stock tablet or phone with Android 3.1+ and USB host functionality is all you need.

    The above mentioned guide actually reads “Android USB Host + Arduino: How to communicate without rooting your Android Tablet or Phone”. It also shows you how to investigate and communicate with USB-serial converters such as the Arduino ATMega8u2 through the Android USB host API.

  9. I’m looking for some help with using an Android smartphone as a USB host. I’ve done quite a bit of driver-level Linux development, but I’m totally new to Android.

    I currently am working with a portable x86 system with quite a few custom USB slave devices that already have firmware and Linux drivers written. In addition, many of these devices are connected via USB hubs and rely on the usbserial driver.

    I would like to replace the x86 computer with some commercial Android smartphone.

    Originally, I had planned on using our docking station as the USB host for all devices including the phone. This article has me wondering if the phone itself could serve as the USB host. I don’t want to be endlessly hacking things that might or might not work. I want a fairly proven solution that would support multiple USB hubs as well as standard Linux drivers like usbserial. (I know FTDI already has an Android version of the USB driver.)

    So, what would be the limitations (specifically of the USB host capability) of an Android phone versus a docking station running a standard Linux USB stack?

    Much thanks in advance,
    Dave …

Leave a Reply to GdoggCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.