Deploying a Titanium project to an Android phone for the first time

This took several hours, with multiple dead ends, but here’s my story of getting my first Titanium app deployed to an Android device, using Windows 7 64-bit Ultimate.

First, which phone to get? Obviously I want the cheapest possible, with no commitment. It doesn’t need to even be activated, since I won’t be making any calls with it; it’ll just be used as a test platform over wifi and USB. And for a realistic scenario, I want the lowest-end OS possible (Android 2.1 in this case). So I got a no-contract Samsung Intercept, over Virgin Mobile, from BestBuy for $169. I realize that eventually I’ll need to get a real developer phone (like a Nexus S) but that shouldn’t be necessary initially. Turns out it isn’t, fortunately.

  1. First set up device for wifi.
    1. Good idea to write down the battery serial # first in case you need it later: XXXXXXXXX/XXX
    2. Install the battery. Strangely with no directions in the package this took a bit to figure out (I did end up googling for and downloading these manuals here and here. Eventually I used my fingernail to pop off the back cover, which was pretty flimsy.
    3. Once it’s charged, go to the home screen, scroll to Settings and tap.
    4. Check Wi-Fi to turn it on.
    5. Click “Wi Fi Settings” / Add Wi-Fi Network and enter your key. Now you’re connected and can browse the web.
  2. Set up the phone for debugging.
    1. When I plugged the USB into my PC for the first time, it got a “driver install failed” error, which I ignored. Turns out I shouldn’t have. Read on.
    2. In Titanium Developer, load your Titanium Project and confirm the Android SDK version is low enough for the device. You can find the Android version from the phone by going to Settings / About Phone. In my case it’s “2.1update1” and 2.2 is not out just yet.
    3. Go to Run on Device tab, then click the gray “Install Now” button. The yellow alert box in the upper right will say “Installing app to device”, but goes away after maybe a minute. That was easy!
    4. I check my phone though, and my app is not there. This sort of thing has been reported before. So I realize this could be a USB driver missing problem.
  3. Get the proper drivers for this phone.
    1. I unplug and then plug in the USB, and it tries again to install the drivers for Samsung Intercept and fails.
    2. Switch to Googling mode. I look online at Samsung.com for the driver, since maybe for some reason Windows doesn’t know about it. Searching by device name doesn’t work (pretty lame website there) so I have to find the Samsung model number, which isn’t anywhere in the packing materials, but I discover is SPH-M910 from looking under Settings / About Phone.
    3. I try to download the latest manual and driver but discover it’s only for XP/Vista, and won’t install on Windows 7 at all. Amazing for a phone that was released just a few months ago (see forums about lacking Win 64-bit drivers here and here).
    4. I google further, and find the unrecognizability in Windows 7 64-bit was related to USB debugging being enabled.
    5. So I disable the USB debugging:
      1. Leave USB unplugged.
      2. Now go to Settings / Applications on phone.
      3. Check “Unknown sources”
      4. Go to Development and check “Stay Awake” and “Allow Mock Locations”.
      5. Turn off phone
      6. Plug USB back in.
      7. Turn on phone
      8. It should now show up in devices in Windows (Control Panel / Hardware and Sound / Devices and Printers) as SAMSUNG_Android.
    6. On the phone, set it to be mountable as a drive.
      1. You should see the little USB symbol at the top of your Android screen.
      2. Touch the top of the screen and scroll it down – you will see “USB Storage” – tap on that.
      3. A new menu will pop up and you should see “Mount” and select it.
    7. Try to install the app again in Titanium, wait a minute for Installing alert to subside, but still same result.
    8. I decide to eliminate Titanium as a possible variable, so I it’s time to back up and see if I can build a simple HelloAndroid app with Eclipse. It builds and runs fine in the emulator. OK, that’s something.
    9. Follow the directions to install the Google USB driver, but this doesn’t work in my case since the Samsung Intercept is not part of the driver INF file. So I add the entries, noting that I also need to add “\” to each lines which was a typo in the post.
    10. Try to update the Samsung device using the new modified INF file via the Device Manager, but Windows claims the most recent version of the driver has already been installed. Strange.
    11. Maybe the INF settings need tweaking so I unplug the phone from USB.
    12. Download, unzip and run the usbdeview utility and try to re-install the INF via that. No difference.
    13. Maybe the Device ID in the INF is incorrect, so find Samsung ID here. I confirm the Device ID’s are correct so that’s not the issue.
    14. Finally a bit of luck, via Google I stumble across this page on a heretofore unknown Samsung mobile developer site. What’s interesting about the developer guide is that even though the page is all about the Galaxy Tab, there’s a download for Samsung Mobile USB drivers that I hadn’t seen anywhere else.
    15. So I created a Samsung developer account needed to download the “Samsung USB Driver for Mobile Phones”.
    16. I uneventfully install this new MSI.
    17. With the phone plugged in, I get an alert saying the driver was installed. So now the moment of truth – can I use USB debugging now?
    18. Unplug phone from USB.
    19. Check “USB Debugging” on phone.
    20. Plug phone into PC.
    21. Now, Windows installs a set of 4 Samsung drivers (specifically USB Composite device, Android USB Mode, USB Mass Storage Device, and (the kicker!) Android Composite ADB Interface.
    22. That looks much better. Check to see if it appears as an ADB device now:
      c:\Program Files (x86)\Android\android-sdk-windows\platform-tools> adb devices
      List of devices attached
      emulator-5560   device
      M9101f380ce9    device

      Yay – there it is!

  4. Now back to Eclipse. Rebuild the HelloAndroid project in Eclipse, and as per these directions, choose to Run at the new device instead of the Emulator. Boom, it gets pushed to the phone and launches automatically.
  5. Now try Titanium Developer. Click install now, wait about 45 seconds, and boom, it’s installed.

I’ve read reports that this is easier on a Mac (deploying to Android “just works”), and probably one of the more expensive phones supported by Google’s USB driver would have made life easier. But now I can say that I have a Titanium app running on a realistic end-user phone.

Next up, deploying to iPhone.

Leave a comment

Your email address will not be published. Required fields are marked *