I’m finally getting into developing for Android. It’s been a rocky few hours but I think I finally have my environment set up. I’ll do posts here as I progress. The first one: getting started with Android and setting up the environment.
Now Google has some pretty good tutorials so I’ll mostly use their material but I’ll make sure to make comment on where I ran into problems.
NOTE: I am using Windows 7 Ultimate 64-bit with a 64bit JDK so all the instructions here will be for Windows 64bit.
If you haven’t already, you’ll need the Sun Java JDK, download it here. I am using the 64bit Java SE JDK 6.
To start off, you’ll need to download the Android SDK. Note that you can also follow the instructions on that page to get your environment set up.
Next you’ll need Eclipse and the Android Development Tools plugin for it. If you already have Eclipse, click here to figure out how to install the plugin. If you need Eclipse, you can download it here. I think they recommend using the Eclipse for Java or Eclipse for RCP/Plug-in but since I’m using 64bit Windows AND 64bit JDK, I had to download the 64bit version of Eclipse Classic (you may have to do the same if you’re using a 64bit OS).
After you have Eclipse, follow the instructions from the link above to get the ADT plugin.
Once you get Eclipse running, you’ll need to download some extra SDK components (for sure at least one Android Platform). You can go here to find out more.
Once you have a platform, you’ll need to create an Android Virtual Device. You can do this from the Eclipse “Android SDK and AVD Manager” (From Eclipse, Window > Android SDK and AVD Manager).
Once everything is set up, follow this tutorial to get started with an Android Project. Note that the tutorial tells you how to create a Virtual Device from the command line.
Here’s where it got tricky for me. After following the “Hello, Android” tutorial and clicking “Run”, nothing happened. No emulator, no nothing. If you look at the console, you may get an error like “emulator: could not find virtual device named <DeviceName>”. After some time on Google, I was able to figure out the problem. What’s happening is that Eclipse is looking for the Virtual Devices to be in the “C:Users<User>.android” folder but for whatever reason, it may not have gotten created in that folder. A solution is to create a symlink. First find out where the Devices got created. You can do this by opening the Android SDK and AVD Manager, clicking on the Virtual Device and click “Details” (for example mine was “G:.android”). Once you get the path, open up a command prompt, cd into “C:Users<User>” and run the command “mklink /J .android G:.android” (except changing the second path to whatever yours is). Then if you try to run the application again, it should work.
And there ya go, Android environment set up and good to go (hopefully anyway, I stopped everything I did once I got things working to write this post).