Download the Android SDK

PhoneGap works in conjunction with the Android SDK, so before we can get started with PhoneGap, we need to download and install the Android SDK itself. Follow the steps here to do so:

1. Navigate to the Android SDK download page and download the package appropriate for your platform. If you are on Windows or Linux, you will need to install Java (see http://java.sun.com/javase/downloads) first. My development machine is a MacBook Pro running Mac OS X 10.6, so in my case, the appropriate package is android-sdk_r06-mac_86.zip for Mac OS X (Intel) (Figure 7-1). The 06 in the SDK filename refers to the version of the Android SDK and may be different at the time you read this.

Android SDK 1 Android Developers

+ |Q http:/Vdeveicpef.andrcid.qMTi/sdk/index, html

CD EE:: Home Maif Cal RTM Twitter Hatch Kilo Facebook ¡73 JSC Router Reader Localhost BookmarkletsT

Dev Guide Reference Resources

Installing the SDK

| search developer docs

( Search

Dev Guide Reference Resources

Blog

Installing the SDK

Downloadable SDK Components

Adding SDK Components Android 2 2 Platform nHWl Android 2 1 Platform Android 1.6 Platform Android 15 Platform • Older Platforms SDK Tools, r6 IWW| USB Driver for Windows, r3

ADT Plugln for Eclipse

ADT 0.9.7 newl Native Development Tools

Android NDK. r4 newl More information

SDK System Requirements SDK Terms and Conditions SDK Archives

Download the Android SDK

3 read the Quick Start, below,

Welcome Developers! If you are new to the Android SDK, pie* for an overview of how to install and set up the SDK.

If you are already using the Android SDK and would like to update to the latest tools or platforms, please use the Android SDK and A VD Manager to get the components, rather than downloading a new SDK package.

Platform

Package

Size

MD5 Checksum

Windows

android-sdk r06-windows.zip

23293160 bytes

7c7fcec3c6b5c7c 3df6ae654b27effb5

Mac OS X (intel)

android-sdk r06-mac 86.zip

1910&077 bytes

c92abf66a82c7a3f2b&493ebe025dd22

Linux (¡386)

android-sdk r06-linux &6.taz

16971139 bytes

948371e4bf068dbb582b709f4e56d903

Quick Start

The steps below provide an overview of how to get started with the Android SDK. For detailed instructions, start with the Installing the SDK guide.

Figure 7-1. Download the appropriate Android SDK for your development machine

Java comes preinstalled on Mac OS X and is available in most Linux package managers. If you install it on Windows, you'll need to set your JAVA_HOME environment variable. Follow the instructions in "Setting Up the Environment" on page 115, but instead of modifying the PATH environment variable, create a new environment variable called JAVA_HOME and set it to the directory that Java was installed in (such as C:\Program Files\]ava\jdk1.6.0_21).

2. Unzip the downloaded archive to whichever directory you like. I'm going to put mine on the desktop.

On Windows, you won't be able to use the ~ shortcut for your home directory. Also, you should avoid spaces in the path names, so if you are using Windows XP (which puts at least two spaces in your home directory due to home directories residing in Documents and Settings), you should create a directory such as C:\Source instead of putting things on your desktop.

3. For simplicity's sake, I'm going to rename the unzipped SDK directory to Android.

4. Launch the Terminal application and navigate into the tools subdirectory of the Android SDK directory. If you put the Android directory on your desktop and renamed it, use the following command:

cd ~/Desktop/Android/tools/

On Linux, the command will be the same (if you put the Android directory in the Desktop subdirectory of your home directory). On Windows, the command would be something like:

cd %USERPROFILE%\Desktop\Android\tools

5. Enter the following command to launch the Android SDK and AVD Manager. On the Mac or on Linux, the command is:

./android On Windows, the command is:

android

6. When the Android SDK and AVD Manager window opens, click Available Packages in the left sidebar. You should see a single item appear in the Sites, Packages, and Archives panel (Figure 7-2).

7. Check the box next to https://dl-ssl.google.com/android/repository/repository.html to install all of the available packages and archives (Figure 7-3).

8. Click the Install Selected button in the lower right corner of the window.

9. A window will appear asking you to accept the license terms. Read the terms, check the box next to Accept, and click the Install button to begin your download (Figure 7-4).

Figure 7-2. Use the Android SDK and AVD Manager to download SDK packages for particular versions of the Android OS
https://dl-ssl.google.com/android/repository/repository.html and click the Install Selected button"/>
Figure 7-3. Check the box next to https://dl-ssl.google.com/android/repository/repository.html and click the Install Selected button
Figure 7-4. Read and accept the platform description and license, then click the Install button

10. When your download completes, click Close to close the download window.

11. On Mac OS X, select Quit Android from the Android menu to leave the Android app. On Windows or Linux, simply close the window.

0 0

Post a comment