Sunday, November 1, 2009

Tutorial - Getting Started with Android 2.0 Development in Eclipse [Eclair version and up]

Since I formatted my pc and had not been touching my Android development and am not a coder in real life, it's rough trying to recall how to set up ADT development in Eclipse. I find the new method of installing the Android SDK a pain in the ass, compared to the old method. Thanks Google =P

So I thought I would write out the procedure here, to also benefit others who want to get started in Android.
  1. Install Eclipse [latest version: Galileo, i.e. Eclipse 3.5]. At least download the version for Java Developers.
  2. Unzip Eclipse and set up your Workspace (where all your projects will be defaulted to). You may prefer to do so, so that you can refer to the different projects at one go, rather than open multiple Eclipse workspace and kill your pc.
  3. Download and install the ADT Plugin. Google says it best here, so follow the instructions under "Installing the ADT Plugin -> Eclipse 3.5 (Galileo)".
    • Remember to restart Eclipse after this step.
  4. Download the latest SDK . For additional professional techie advice, refer to Android page.
    • Unzip the SDK and run the SDK Setup.exe. It is found in the SDK folder ([folder that you unzipped it to]:\android-sdk_r3-windows\android-sdk-windows)
    • If you have left the SDK folder open after clicking on the SDK Setup.exe? Close it!!! Or you have run the stupid Android SDK and AVD Manager (downloader and installer) again.
    • Also, close all Eclipse Dialogs.
    • After you run the SDK Setup. exe, it opens the Android SDK and SVD Manager. You can see under Installed Packages that you have installed the Android SDK Tools. good but not enough. Go to Available Packages and install all the packages from SDK source: (Currently finds 10 packages).
    • Android will ask you to choose the packages to install. Just Accept all, unless you are so bothered to read it. In the end, Google will still executes its rights as owner, so why bother?
    • Sometimes you will encounter a https error, and it will ask you to force the sources to be fetched using http. In that case, go to Settings and click on Force https://... sources to be fetched using http://.
  5. Check under Installed Packages. You should now see Android SDK Tools (revision 3 for me), SDK Platform Android 2.0, 1.6, 1.5, 1.1 and Google APIs by Google Inc for the various Android APIs 3,4,5, USB Driver package.
  6. In Eclipse, select Window > Preferences... to open the Preferences panel.
  7. Select Android from the left panel and click Browse to hunt for the downloaded SDK location in the main panel. Choose the folder that contains the Tools folder, i.e. [folder that you unzipped it to]:\android-sdk_r3-windows\android-sdk-windows.
  8. Click Apply, then OK. When you clicked Apply, you better see something inside the box. above the Apply button. Note: it is highly likely you need to run the Install Selected multiple times. You need patience. It's only half as bad as running the patches for CoH.
Yer done! Start work on your latest Android Project today!!! Oh ya, when you are creating a new Android project and you don't see anything under Build Target, don't panic. It means that your SDK is not pointed correctly. Go to Windows > Android SDK and AVD Manager and check your packages again.

No comments:

Post a Comment


Related Posts with Thumbnails