In my previous post, I gave a brief overview of the current state of computing and why I felt that being an expert in .NET is not enough to effectively address the mobile market. I chose to learn to develop for Android first. Before I delve into what you’ll need to get started programming for Android, I’d like to go over a bit of background on Android. This background will help you understand why you need what you need to get up and programming.
The core of the Android platform is ran on a Linux kernel which has all the drivers needed to run the display, camera, keypad, flash memory, etc. On top of that, we have native libraries (OpenGL, SQLite, etc) and the Java virtual machine (JVM) which is responsible for interpreting and executing Java bytecode. Android has its own JVM called the Dalvik VM which is highly optimized to run on low-end handled devices. As applications invoke these core libraries, each application gets its own Dalvik VM instance to execute under. On top of the Linux kernel and native libraries/VM, we have the Android Java API’s which include UI, package installs and security, telephony, locations, resources, graphics libraries, etc. Basically the Android SDK supports most of the Java Platform but replaces the Abstract Window Toolkit (AWT) and Swing with it’s own fourth generation UI framework. So from this architecture, we can assume we are going to need java and android software development kits, and an IDE to program, compile, and simulate such.
As a .NET developer, I am very familiar with Visual Studio and TFS. I currently program in VB, however I do have a C# background as well. It would be wonderful if I could leverage Visual Studio as my IDE along with already known programming languages to program for Android. Technically, building Android apps can be done in Visual Studio either by getting creative with batch scripts and workarounds, using WinGDB, or by purchasing Mono for Android for $300. Each of these solutions have some serious drawbacks such as spending money, no intellisense support, and larger application download size. On top of this, most tutorials on the web are tailored for Eclipse for Java Developers, not Visual Studio. On a good note, TFS can integrate into Eclipse with Microsoft Visual Studio Team Explorer Everywhere 2010. As a result, I plan to stomach the pain of learning a new IDE and going with Eclipse for Java Developers. I’ll have TFS integration, it’s free, most online tutorials will be using it, there is an ADT plugin which offers GUIs and wizards to assist in project creation, and I’ll have intellisense support. The only unknown I have is TFS auto-builds. A quick glance on the web appears to have some solutions, so I’ll cross that bridge when I get there.
Now that I know I want to use Eclipse as my IDE with TFS integration, I need to download and install the items I need. Here are the steps that I took to get my development environment up and going on Windows 7.
1) Install the Java Platform (JDK – Java Development Kit) – You need this to develop Java applications on your computer. Download and install the 32-bit version as other items we will be downloading and installing will be 32-bit.
2) Add the JDK path to your System Environment Variables – This will allow you tap into executables provided via the JDK from the command prompt. In Windows 7, you can do so by right-clicking Computer >> Properties >> Advanced System Settings >> Environment Variables >> User variables for xxxxx >> New. Variable name will be “Path”. Variable value will be the local path to where the JDK bin directory is. On my machine it was “C:\Program Files\Java\jdk1.7.0\bin”.
3) Install the Android SDK (Software Development Kit) – This kit will provide the libraries necessary for you to develop Android applications. After you’ve downloaded and installed this, you should have the Android SDK manager application. This will allow you to download and update the Android SDK libraries and components. I went ahead and launched the program and had it install & update everything. Warning: it took a long time to do this.
4) Install Eclipse for Java Developers - This is the IDE of choice for developing Android apps. It’s free and plugins are available for Android and TFS. Again, download and install the 32-bit version of it.
5) Install the ADT Plugin for Eclipse (Android Development Tools) – You can download and install this plugin by navigating to Help >> Install New Software in Eclipse. It should bring up a dialog which you can click the “Add” button which will bring up an “Add Repository” dialogue. Within this window, you can give it a name of “Android ADT” and for the Location type in: “https://dl-ssl.google.com/android/eclipse/”. Confirm, select all available components to install, and click through the wizard and it should download and install the ADT plugin into your Eclipse IDE. For more information click here.
6) Set the Android SDK Location in Eclipse – In Eclipse, you need to set the Android SDK location. To do this, go to Window >> Preferences >> Android in Eclipse. Browse to the Android SDK install location. On my machine, it was “C:\Program Files\Android\android-sdk”.
7) Install the TFS Plugin for Eclipse (Microsoft Visual Studio Team Explorer Everywhere 2010) – If you want to integrate TFS into Eclipse, you’ll need a license for Team Explorer Everywhere and need to download the “TFSEclipsePlugin-UpdateSiteArchive-10.1.0.zip” (or whatever version is the latest when you go to install it). Like the ADT Plugin, you have to install the plugin by going to Help >> Install New Software in Eclipse. This time, you can browse to your local disk and select the “TFSEclipsePlugin-UpdateSiteArchive-10.1.0.zip” file for the location instead of a remote URL like before. You can add a project to TFS by right-clicking a project and going to Team >> Share Project. The first time you run the TFS plugin, you’ll be prompted to enter your license key. You should be able to take it from here.
So there you have it. 6-7 steps to setting up your machine to develop for Android. Most of the steps are for setting up the Eclipse IDE. It definitely is not the 4 hour install process that Visual Studio makes you go through, but it does require manual setup. The nice thing is that all of this is free except for the TFS piece. I already had an MSDN subscription so this wasn’t an issue for me, but it may be an issue for others. In that case, you could probably find other options to use for your source control.