Monday, October 11, 2010

Setting Up an Android Development Environment

My HP DV8T laptop is now setup as an Android application development environment. It was very easy to do so and everything worked the first time. I was able to create, test and debug the infamous “Hello World" app within 5 minutes of having completed the environment. The instructions I am providing here are for the Windows platform only. If you want to program in Linux or on a MAC, please visit the Android Developer Site for those platforms’ details.

To get going, you only need four things, two of which are required and two are optional:

  1. Java Development Kit (JDK) version 5 or 6
  2. Android SDK
  3. Optional: Eclipse Version 3.4 or 3.5
  4. Optional: Android Development Tools (ADT) Plugin

If you are new to programming, the term “SDK” means “Software Development Kit.” SDKs are sometimes called “devkits.” Typically, a SDK is a set of tools that allows for the creation of an application for a specific software package, software framework, hardware platform, computer system, video game console, operating system or similar platform.

Java JDK

The Java Development Kit is available at Oracle's Java Download site. Simply download either the 32-bit or 64-bit version of the JDK depending on your OS version and run the program to install.

Eclipse

Eclipse is a very popular and free integrated development environment (IDE) available from Eclipse.org. An IDE provides comprehensive facilities to computer programmers for software development. An IDE normally consists of: a source code editor, a compiler and/or an interpreter, build automation tools and a debugger. For developing Android applications, it’s recommended that you install one of these packages:

  • Eclipse IDE for Java EE Developers
  • Eclipse IDE for Java Developers
  • Eclipse for RCP/Plug-in Developers
  • Eclipse Classic (versions 3.5.1 and higher)

There’s one BIG caveat to installing Eclipse. The Android Development Tools Plugin has known incompatibilities with the current version of Eclipse (3.6). If you are installing a fresh environment, it is recommended that you install version 3.5.x. I decided to install the 3.5.2 classic version and it was a painfully slow download. The package is a 168mb .zip file that took two days to download. The download kept timing out and I had to restart it many, many times. I’m very grateful that each time I restarted the download, it picked up again from where it had previously stalled. Unzip the Eclipse .zip file to the location of your choice and create a shortcut to the Eclipse executable and you’re ready to go. There is no Eclipse installer to run.

Android Development Kit

The Android Development Kit (ADK) is another .zip file like Eclipse. Once it’s downloaded, unzip the file to the location of your choice. Again, like Eclipse, there is no windows installer to run. It’s important to note that what you have just downloaded is the ADK starter package only. You haven’t downloaded any of the real ADK SDKs yet. To download the actual SDK and Google application programming interfaces (APIs), run the SDK Manager program located in the directory in which you unzipped the ADK starter package.

When you run the SDK Manager, you’ll be presented with a list of available SDK and API packages. I installed the Android 2.1 and 2.2 SDKs, samples for the two SDKs, APIs 7 and 8, documentation for API 8, USB Driver package and Market Licensing package. Once selected for download, the items download and install automatically. Google has done a great job making the install as easy as possible for developers.

After the SDKs are downloaded and installed, create at least one virtual device with the SDK Manager. The virtual device is a SDK platform specific emulator you can use later for testing your applications.

Android Development Tools Plugin

The Android Development Tools Plugin is installed from within Eclipse itself. To install the ADT, follow these directions from the Android Developer web site:

  1. Start Eclipse, then select Help > Install New Software.
  2. In the Available Software dialog, click Add....
  3. In the Add Site dialog that appears, enter a name for the remote site (for example, "Android Plugin") in the "Name" field.

    In the "Location" field, enter this URL:

    https://dl-ssl.google.com/android/eclipse/

    Note: If you have trouble acquiring the plugin, you can try using "http" in the URL, instead of "https" (https is preferred for security reasons).

    Click OK.

  4. Back in the Available Software view, you should now see "Developer Tools" added to the list. Select the checkbox next to Developer Tools, which will automatically select the nested tools Android DDMS and Android Development Tools. Click Next.
  5. In the resulting Install Details dialog, the Android DDMS and Android Development Tools features are listed. Click Next to read and accept the license agreement and install any dependencies, then click Finish.
  6. Restart Eclipse.

Hang in there, we’re almost done. There’s one step left and you’ll be on your way to developing your first Android application. Now that the ADT is installed, it needs to be configured to work with the Android SDK. To configure the ADT, you must point it to the Android SDK directory. From within Eclipse:

  1. Select Window > Preferences... to open the Preferences panel
  2. Select Android from the left panel.
  3. For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory.
  4. Click Apply, then OK.

Android Market Developer Account

Once you start writing your own Android applications, you might just be the one to make a fortune with “the killer app” that everyone else dreams of writing. To sell on the Android Market, you must have an Android Market Developer account. Google charges $25.00 USD to open an Android Market account. They also make it very easy to accept payments through the Google checkout system once you have an Android Market account by offering you to open a Google checkout merchant account. As with any merchant account, Google charges a transaction fee on each of your sales. The normal transaction fees are based on a sliding scale determined by the amount of your monthly sales. For example, if you sell less than $1,000 per month, you pay 2.9% + $.30 for each sale. But for anything sold through the Android Market, the fee structure is vastly different.

As of the time of this writing, the transaction fee for anything sold through the Android Market is 30%. Yes, that’s right! Google charges a whopping 30% fee on anything you sell through the Android Market and of course, you are responsible for collecting and paying any applicable sales taxes. If only I had the foresight to buy Google stock back in the day!

No comments:

Post a Comment