My final year project is a ticket booking system for a mobile device, and I’ve chosen to target Android and develop an application for my HTC Hero.
I followed the set up instructions in my copy of Android Application Development (which are pretty much the same as the instructions on the Android Dev site), but when I tried to run a simple Hello World type app on my handset I had problems.
I would plug my phone in, as per the instructions, but it wouldn’t be detected. Eclipse is supposed to recognise my phone as valid build target and be able to install and run the app on my phone via USB, but it didn’t.
To be clear, the phone had debug via USB enabled and apart from not being detected by Eclipse worked fine when mounting the SD card as removable USB storage.
Running ADB from the command line also indicated a problem: I ran adb devices with my phone connected, but no devices were listed.
I already had the most up to date driver from Google, but there seemed to be something wrong.
I found a guide to installing ADB via Google, and despite doing everything that was suggested, including the instructions in the “Im not getting a notification of Android ADB when i plug in my USB” [sic], but nothing changed.
However, I installed USBDeview as suggested and looked at the drivers. They all appeared to be present and correct, but I noticed the ADB driver wasn’t shown as being connected when the phone was plugged in. This further confirmed my suspicion that the problem was dodgy drivers.
Eventually I found a way of getting working drivers installed, although it’s far from a standard approach.
First you need to use USBDeview to remove the existing drivers. I found there were 3: one with a device name: “Android Phone”; another as with no device name but labelled “ADB Interface” in the descripton; and another that again had no device name but was described as “USB Mass Storage Device”.
Then you need to install PdaNet for Android, an application that allows you to use your Android phone as a USB modem, which comes with a version of the ADB drivers that work fine for me.
My hunch is that it’s something to do with me running 64-bit XP (I also cannot install HTC Sync because of issues I think related to XP x64) although why these drivers should work while the official ones don’t I can’t imagine.
The drivers are installed when you install the program, and you don’t need to keep the program installed once the drivers are working, you can remove it and the drivers will remain.
One slightly tricky bit I encountered: When I was installing, XP defaulted to installing the Google drivers that weren’t working for me.
To get around this, when the PdaNet installer displays a prompt asking you to click yes when the drivers have installed (which may prompt XP to (re)install the Google drivers) go into device manager, find the ADB driver in the list, usually under ADB Interface, and bring up the properties window. Select the update driver option.
This will start the Hardware Update Wizard. Tell Windows not to connect to the internet to search for updates and click next.
On the next screen, select “Install from a list or specific location” and click next.
On the screen that follows, select “Don’t search. I will choose the driver to install” and click next.
You will now see a list of available drivers. One will be Google’s and the other the one we want.
It is labelled HTC Dream Composite ADB Interface. It isn’t digitally signed, but don’t worry about that
(Disclaimer: it works for me and I’ve had no problems so far, but that doesn’t mean it will definitely work for you)
Now, simply continue with the driver installation, and once the driver installation is complete ADB should work fine. At this point it doesn’t matter if PdaNet installs correctly or not (something caused it to fail for me, but ADB still works fine)
Tags: Android, development