Recently I picked up a new Motorola Droid phone and an HTC Droid Eris for the misses. I have done some iPhone development, however, I’ve never picked up an iPhone because ATT coverage in NYC is terrible. So I wanted to see how easy it would be to write a simple Android based app.
I’m this blog post will outline steps I took to get setup. I often find blog posts like this helpful for people getting started. There are plenty of resources right now on it, but one more couldn’t hurt. I’m using Windows 7 64bit, so the issues I run into might or might not be related. Either way I’ll try to solve them along the way.
- Eclipse 3.5 from http://www.eclipse.org/downloads/ Windows 32bit via BitTorrent
- Android SDK from http://developer.android.com/sdk/index.html
- Install Developer Tools using Eclipse Update from this site: https://dl-ssl.google.com/android/eclipse/
- Restart Eclipse
- Go to Preferences -> Android and enter in folder of Android SDK
Android SDK Setup:
- Run SDK Setup.exe in the Android SDK directory.
- If it can’t connect, go to “Settings” and select force https sources to be fetched using http (I had to do this).
- I installed Documentation, USB Driver, SDK 2.0.1 (for Droid Phone), SDK 1.5 (for Droid Eris), and the respective Google Api’s (3 for 1.5 and 6 for 2.0.1)
- Once Installed, click Devices.
- Create 2 devices, one for each phone / SDK.
- To setup the “Path”, Go to Start menu -> Right click on Computer -> select Properties -> Advanced Settings -> Environment Variables -> Find “Path” in the bottom list.
- Copy / Paste your Android SDK / Tools directory from Explorer and add it to the end of the Path variable. Ad
USB Driver Setup:
- On the Phone go to Settings -> Application Settings -> Development -> Check USB Debugging
- Plug in Phone to computer
- Windows 7 said “Couldn’t find driver”.
- Click on Start menu, right click Computer, click Manage, select Device Manager.
- Find the Motorola device with the yellow yield icon. Right click and select Update Device Software.
- Select “Browse my computer”. Point the search at the Android SDK -> USB Driver folder.
Now for the Hello World App. I used the tutorial here: http://developer.android.com/resources/tutorials/hello-world.html
When you have the phone plugged in via USB and you “Run” or “Debug” it’ll run on the phone if the emulator isn’t running. It was weird at first, because I couldn’t figure out why it wasn’t showing up in the emulator. I unplugged the phone, and the app ran in the debugger (which took a little while to load). When running or debugging that application later, you can chose to run on the phone or the emulator.
Thats it for the “Hello World App”. I then installed the “API Demos” app from here: http://developer.android.com/resources/samples/ApiDemos/index.html
Interesting things to note about the API Demo’s is the features that work in the emulator and those that don’t. Like the camera based view had a demo video going, and the voice recognition part didn’t work.
Next up is what I hope is my first app for the Android, a Pantry Management System that will use the ZXing Barcode scanner API and allow you to catalog your pantry easily.