Tutorial:Getting started with Android

From Notes

Jump to: navigation, search

This page is meant to summarize the official guides for downloading and installing the Android SDK and setting up the Eclipse development environment.

The rest of this page summarizes the installation and setup procedure. You can get more detailed instructions by going directly to the above links.

Contents

Eclipse Preliminaries

Android development in Eclipse works best under the following conditions:

  • The latest version of Eclipse (at least 3.2 or 3.3) is installed with the following plugins:
    • Eclipse JDT plugin (Java Development Tools)
    • The WST plugin (Web Standard Tools) is useful for XML editing and recognizes Android XML tags.

See http://www.eclipse.org/downloads/moreinfo/compare.php to compare versions of Eclipse. The JEE version of Eclipse includes the JDT and WST plugins.

Before proceeding, make sure you have the latest version of Eclipse for JEE installed.

Installing the SDK

After downloading the SDK, unzip the .zip archive to a suitable location in the computer.

$ unzip android_sdk_linux_m5_r1*zip 

Make a note of the SDK location. You will need to substitute that location for <your_SDK_directory>. Yes, including the brackets.

Optional: Updating your PATH Variable

In order to use Android commands from any directory, it is necessary to update your system's PATH variable.

For Linux and MacOS users: Place the following line (without quote marks) into your .bash_profile file in your home directory:

export PATH=${PATH}:<your_sdk_directory>/tools

where <your_sdk_directory> is the complete path name to your android directory. If you don't have a .bash_profile you can create one with that line in it. This will allow you to run Android tools from within any directory on your system. You will have to close and then reopen your terminal window in order for the $PATH variable to be updated.

For windows users:

  1. From the desktop, right-click My Computer and click properties.
  2. In the System Properties window, click on the Advanced tab.
  3. In the Advanced section, click the Environment Variables button.
  4. Finally, in the Environment Variables window, highlight the path variable in the Systems Variable section and click edit. Add or modify the path lines with the paths you wish the computer to access. Each different directory is separated with a semicolon as shown below.
C:\Program Files;C:\Winnt;C:\Winnt\System32;<your_SDK_directory>/tools

Installing the Eclipse Plugin

  • Start Eclipse, then select Help > Software Updates > Find and Install....
  • In the dialog that appears, select Search for new features to install and press Next.
  • Press New Remote Site.
  • In the resulting dialog box, enter a name for the remote site (e.g. Android Plugin) and enter this as its URL:
https://dl-ssl.google.com/android/eclipse/

Press OK.

  • You should now see the new site added to the search list (and checked). Press Finish.
  • In the subsequent Search Results dialog box, select the checkbox for Android Plugin > Developer Tools. This will check both features: "Android Developer Tools", and "Android Editors". The Android Editors feature is optional, but recommended. If you choose to install it, you need the WST plugin mentioned earlier in this page.

Now press Next.

  • Read the license agreement and then select Accept terms of the license agreement, if appropriate. Press Next.
  • Press Finish.
  • The ADT plugin is not signed; you can accept the installation anyway by pressing Install All.
  • Restart Eclipse.

Updating the Eclipse Preferences

  • After restart, update your Eclipse preferences to point to the SDK directory:
  • Select Window > Preferences... to open the Preferences panel. (Mac OS X: Eclipse > Preferences)
  • Select Android from the left panel.
  • For the SDK Location in the main panel, press Browse... and locate the SDK directory.
  • Press Apply, then OK.

References

http://code.google.com/android/intro/installing.html

Personal tools
NSF K-12