Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 1 | page.title=Installing the SDK |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 2 | sdk.preview=0 |
| 3 | |
| 4 | @jd:body |
| 5 | |
| 6 | <div id="qv-wrapper"> |
| 7 | <div id="qv"> |
| 8 | |
| 9 | <h2>In this document</h2> |
| 10 | <ol> |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 11 | <li><a href="#Preparing">1. Preparing Your Development Computer</a></li> |
| 12 | <li><a href="#Installing">2. Downloading the SDK Starter Package</a></li> |
| 13 | <li><a href="#InstallingADT">3. Installing the ADT Plugin for Eclipse</a></li> |
| 14 | <li><a href="#components">4. Adding Platforms and Other Components</a> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 15 | <ol> |
| 16 | <li><a href="#which">Which components do I need?</a></li> |
| 17 | </ol></li> |
| 18 | <li><a href="#sdkContents">Exploring the SDK</a></li> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 19 | <li><a href="#NextSteps">Next Steps</a></li> |
| 20 | <li><a href="#troubleshooting">Troubleshooting</a></li> |
| 21 | </ol> |
| 22 | |
| 23 | <h2>See also</h2> |
| 24 | <ol> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 25 | <li><a href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin for Eclipse</a></li> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 26 | <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li> |
| 27 | </ol> |
| 28 | |
| 29 | </div> |
| 30 | </div> |
| 31 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 32 | <p>This page describes how to install the Android SDK |
Dirk Dougherty | a374f51 | 2009-11-09 11:41:09 -0800 | [diff] [blame] | 33 | and set up your development environment for the first time.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 34 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 35 | <p>If you encounter any problems during installation, see the |
Dirk Dougherty | a250f0c | 2009-10-22 18:02:45 -0700 | [diff] [blame] | 36 | <a href="#troubleshooting">Troubleshooting</a> section at the bottom of |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 37 | this page.</p> |
| 38 | |
| 39 | <h4>Updating?</h4> |
| 40 | |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 41 | <p>If you already have an Android SDK, use the <em>Android SDK and AVD Manager</em> tool to install |
| 42 | updated tools and new Android platforms into your existing environment. For information about how to |
| 43 | do that, see <a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 44 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 45 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 46 | <h2 id="Preparing">Step 1. Preparing Your Development Computer</h2> |
| 47 | |
| 48 | <p>Before getting started with the Android SDK, take a moment to confirm that |
| 49 | your development computer meets the <a href="requirements.html">System |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 50 | Requirements</a>. In particular, you might need to install the <a |
| 51 | href="http://java.sun.com/javase/downloads/index.jsp">JDK</a>, if you don't have it already. </p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 52 | |
| 53 | <p>If you will be developing in Eclipse with the Android Development |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 54 | Tools (ADT) Plugin—the recommended path if you are new to |
| 55 | Android—make sure that you have a suitable version of Eclipse |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 56 | installed on your computer (3.4 or newer is recommended). If you need |
| 57 | to install Eclipse, you can download it from this location: </p> |
| 58 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 59 | <p style="margin-left:2em;"><a href= |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 60 | "http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a></p> |
| 61 | |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 62 | <p>For Eclipse 3.5 or newer, the "Eclipse Classic" version is recommended. Otherwise, a Java or |
| 63 | RCP version of Eclipse is recommended.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 64 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 65 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 66 | <h2 id="Installing">Step 2. Downloading the SDK Starter Package</h2> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 67 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 68 | <p>The first step in setting up your environment for developing Android applications |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 69 | is downloading the Android SDK starter package.</p> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 70 | |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 71 | <p>The starter package is not a full |
| 72 | development environment—it includes only the core SDK Tools, which you can |
| 73 | use to download the rest of the SDK components (such as the platform system images). </p> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 74 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 75 | <p class="note"><strong>Note:</strong> If you're using Windows, we recommend that you download |
| 76 | the SDK installer (the {@code .exe} file from the download table). It will guide you through the |
| 77 | installation process and check your computer for the required software.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 78 | |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 79 | <p>You can get the latest version of the SDK starter package from the <a |
| 80 | href="{@docRoot}sdk/index.html">SDK download page</a>.</p> |
| 81 | |
| 82 | <p>If you downloaded a {@code .zip} or {@code .tgz} package (instead of the SDK installer), unpack |
| 83 | it to a safe location on your machine. By default, the SDK files are unpacked |
| 84 | into a directory named <code>android-sdk-<machine-platform></code>.</p> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 85 | |
| 86 | <p>Make a note of the name and |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 87 | location of the unpacked SDK directory on your system—you will need to |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 88 | refer to the SDK directory later, when setting up the ADT plugin and when using |
| 89 | the SDK tools from command line.</p> |
| 90 | |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 91 | <p>Optionally, you might want to add the location of the SDK's |
| 92 | <code>tools/</code> directory and {@code platform-tools/} directory to your system |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 93 | <code>PATH</code>. Both tool directories are located at the root of the SDK folder. Adding |
| 94 | <code>tools/</code> and {@code platform-tools/} to your path lets you run Android Debug Bridge (adb) |
| 95 | and the other command line <a |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 96 | href="{@docRoot}guide/developing/tools/index.html">tools</a> without needing to |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 97 | supply the full path to the tool directories. </p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 98 | |
| 99 | <ul> |
| 100 | <li>On Linux, edit your <code>~/.bash_profile</code> or <code>~/.bashrc</code> file. Look |
| 101 | for a line that sets the PATH environment variable and add the |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 102 | full path to the <code>tools/</code> and {@code platform-tools/} directories to it. If you don't |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 103 | see a line setting the path, you can add one:</li> |
| 104 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 105 | <ul><code>export PATH=${PATH}:<your_sdk_dir>/tools:<your_sdk_dir>/platform-tools</code></ul> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 106 | |
| 107 | <li>On a Mac OS X, look in your home directory for <code>.bash_profile</code> and |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 108 | proceed as for Linux. You can create the <code>.bash_profile</code> if |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 109 | you haven't already set one up on your machine. </li> |
| 110 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 111 | <li>On Windows, right-click on My Computer, and select Properties. |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 112 | Under the Advanced tab, hit the Environment Variables button, and in the |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 113 | dialog that comes up, double-click on Path (under System Variables). Add the full path to the |
| 114 | <code>tools/</code> and {@code platform-tools/} directories to the path. </li> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 115 | </ul> |
| 116 | |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 117 | <p>If you will be using the Eclipse IDE, the |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 118 | next section describes how to install the Android Development Tools (ADT) plugin |
| 119 | and set up Eclipse. If you choose not to use Eclipse, you can develop Android |
| 120 | applications in an IDE of your choice and then compile, debug and deploy using |
| 121 | the tools included in the SDK (skip to <a href="#components">Adding Platforms |
| 122 | and Other Components</a>).</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 123 | |
| 124 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 125 | <h2 id="InstallingADT">Step 3. Installing the ADT Plugin for Eclipse</h2> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 126 | |
| 127 | <p>Android offers a custom plugin for the Eclipse IDE, called Android |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 128 | Development Tools (ADT), that is designed to give you a powerful, integrated |
| 129 | environment in which to build Android applications. It extends the capabilites |
| 130 | of Eclipse to let you quickly set up new Android projects, create an application |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 131 | UI, debug your applications |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 132 | using the Android SDK tools, and even export signed (or unsigned) APKs in order |
| 133 | to distribute your application. In general, developing in Eclipse with ADT is a |
| 134 | highly recommended approach and is the fastest way to get started with Android. |
| 135 | </p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 136 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 137 | <p>If you'd like to use ADT for developing Android applications, install it now. |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 138 | Read <a href="{@docRoot}sdk/eclipse-adt.html#installing">Installing the ADT Plugin</a> for |
| 139 | step-by-step installation instructions, then return here to continue the |
| 140 | last step in setting up your Android SDK.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 141 | |
| 142 | <p>If you prefer to work in an IDE other than Eclipse, you do not need to |
| 143 | install Eclipse or ADT, instead, you can directly use the SDK tools to build and |
Dirk Dougherty | eeb0b25 | 2009-10-22 16:08:32 -0700 | [diff] [blame] | 144 | debug your application.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 145 | |
Dirk Dougherty | bf15ce6 | 2009-10-23 19:17:12 -0700 | [diff] [blame] | 146 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 147 | <h2 id="components">Step 4. Adding Android Platforms and Other Components</h2> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 148 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 149 | <div class="sidebox-wrapper" style="margin-right:2.5em;"> |
| 150 | <div class="sidebox"> <h2>Using the Android SDK and AVD Manager</h2> |
Dirk Dougherty | bf15ce6 | 2009-10-23 19:17:12 -0700 | [diff] [blame] | 151 | |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 152 | <p>The <em>Android SDK and AVD Manager</em> is a tool that you will use often |
| 153 | to add components to your SDK environment and manage <a |
| 154 | href="{@docRoot}guide/developing/tools/avd.html">Android Virtual Devices</a>. |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 155 | </p> |
| 156 | |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 157 | <p>See <a |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 158 | href="adding-components.html">Adding SDK Components</a> for details on how to |
| 159 | launch and use the tool.</p> |
Dirk Dougherty | bf15ce6 | 2009-10-23 19:17:12 -0700 | [diff] [blame] | 160 | </div> |
| 161 | </div> |
| 162 | |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 163 | <p>The last step in setting up your SDK is using the <em>Android SDK and AVD Manager</em> (a |
| 164 | tool included in the SDK starter package) to download |
| 165 | essential SDK components into your development environment.</p> |
Dirk Dougherty | bf15ce6 | 2009-10-23 19:17:12 -0700 | [diff] [blame] | 166 | |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 167 | <p>The SDK uses a modular structure that separates the major parts of the SDK—Android platform |
| 168 | versions, add-ons, tools, samples, and documentation—into a set of separately installable |
| 169 | components. The SDK starter package, which you've already downloaded, includes only a single |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 170 | component: the latest version of the SDK Tools. To develop any Android |
| 171 | application, you also need to download at least one Android platform into your |
| 172 | environment, although downloading additional components is highly recommended. |
| 173 | See <a href="#which">Which components do I need?</a> for information about |
| 174 | which components are required and which are optional.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 175 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 176 | <p>The SDK repository offers these types of components:</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 177 | |
| 178 | <ul> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 179 | <li><strong>SDK Tools</strong> (pre-installed in the Android SDK starter |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 180 | package) — Contains the full set of SDK tools for developing, debugging, |
| 181 | and testing your application code and UI. You can read about the tools in the <a |
| 182 | href="{@docRoot}guide/developing/tools/index.html">Dev Guide</a> and access them |
| 183 | in the <code><sdk>/tools/</code> directory. </li> |
| 184 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 185 | <li><strong>Android platforms</strong> — An SDK platform is |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 186 | available for every production Android platform deployable to Android-powered |
| 187 | devices. Each platform component includes a fully compliant Android library and |
| 188 | system image, sample code, emulator skins, and any version specific tools. For |
| 189 | detailed information about each platform, see the overview documents available |
| 190 | under the section "Downloadable SDK Components," at left. </li> |
| 191 | |
| 192 | <li><strong>SDK Add-Ons</strong> — SDK add-ons provide a development |
| 193 | environment for specific Android external |
| 194 | library or a customized (but fully compliant) Android system image. The Android |
| 195 | SDK repository offers the Google APIs Add-On, which gives your application |
| 196 | access to powerful mapping capabilities through the |
| 197 | <code>com.google.android.maps</code> library. You can also add additional |
| 198 | repositories, so that you can download other SDK add-ons, where available. </li> |
| 199 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 200 | <li><strong>USB Driver for Windows</strong> — Contains driver files |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 201 | that you can install on your Windows computer, so that you can run and debug |
| 202 | your applications on an actual device. You <em>do not</em> need the USB driver unless |
| 203 | you plan to debug your application on an actual Android-powered device. If you |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 204 | develop on Mac OS X or Linux, you do not need a special driver to debug |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 205 | your application on an Android-powered device.</li> |
| 206 | |
| 207 | <li><strong>Samples</strong> — Contains the sample code and apps available |
| 208 | for each Android development platform. If you are just getting started with |
| 209 | Android development, make sure to download the samples to your SDK. <!--The download |
| 210 | includes not only a set of very useful sample apps, but also the source for <a |
| 211 | href="{@docRoot}resources/tutorials/hello-world.html">Hello World</a> and other |
| 212 | tutorials. --></li> |
| 213 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 214 | <li><strong>Documentation</strong> — Contains a local copy of the latest |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 215 | multiversion documentation for the Android framework API. </li> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 216 | </ul> |
| 217 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 218 | <p>To download components, use the graphical UI of the Android SDK and AVD |
| 219 | Manager, shown in Figure 1, to browse the SDK repository, select new or updated |
| 220 | components for download, and then install the selected components in your SDK |
| 221 | environment. </p> |
| 222 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 223 | <div style="TEXT-ALIGN:left;width:600px;"> |
| 224 | <img src="/images/sdk_manager_packages.png" |
| 225 | style="padding-bottom:0;margin-bottom:0;" /> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 226 | <p class="caption" style="margin:0 0 1.5em 1em;padding:0 0 0 |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 227 | 1em;"><strong>Figure 1.</strong> The Android SDK and AVD Manager's |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 228 | <strong>Available Packages</strong> |
| 229 | panel, which shows the SDK components that are |
| 230 | available for you to download into your environment. </p> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 231 | </div> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 232 | |
| 233 | |
| 234 | <h3 id="which">Which components do I need?</h3> |
| 235 | |
| 236 | <p>The SDK repository contains a range of components that you can download. |
| 237 | Use the table below to determine which components you need, based on whether you |
| 238 | want to set up a basic (but functionnal) development environment or a |
| 239 | recommended or full development environment: </p> |
| 240 | |
| 241 | <table style="width:95%"> |
| 242 | |
| 243 | <tr> |
| 244 | <th>Environment</th> |
| 245 | <th>SDK Component</th> |
| 246 | <th>Comments</th> |
| 247 | </tr> |
| 248 | |
| 249 | <tr> |
| 250 | <td rowspan="2" style="font-size:.9em;background-color:#FFE;">Basic</td> |
| 251 | <td style="font-size:.9em;background-color:#FFE;color:gray">SDK Tools</td> |
| 252 | <td style="font-size:.9em;background-color:#FFE;color:gray">If you've installed |
| 253 | the SDK starter package, then you already have this component preinstalled. The |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 254 | SDK Tools and the SDK Platform-tools components are required — you can't develop or build an |
| 255 | application without these. Make sure you keep these up to date.</td> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 256 | </tr> |
| 257 | |
| 258 | <tr> |
| 259 | <td style="font-size:.9em;background-color:#FFE;">SDK platform</td> |
| 260 | <td style="font-size:.9em;background-color:#FFE;">You need to download <strong |
| 261 | style="color:red">at least one platform</strong> into your environment, so that |
| 262 | you will be able to compile your application and set up an Android Virtual |
| 263 | Device (AVD) to run it on (in the emulator). To start with, just download the |
| 264 | latest version of the platform. Later, if you plan to publish your application, |
| 265 | you will want to download other platforms as well, so that you can test your |
| 266 | application on the full range of Android platform versions that your customers |
| 267 | are using.</td> |
| 268 | </tr> |
| 269 | <tr> |
| 270 | <td colspan="3" style="border:none;text-align:center;font-size:1.5em;font-weight:bold;">+</td> |
| 271 | </tr> |
| 272 | <tr> |
| 273 | <td rowspan="3">Recommended</td> |
| 274 | <td>Documentation</td> |
| 275 | <td>The Documentation component is useful because it lets you work offline and |
| 276 | also look up API reference information from inside Eclipse.</td> |
| 277 | </tr> |
| 278 | |
| 279 | <tr> |
| 280 | <td>Samples</td> |
| 281 | <td>The Samples components give you source code that you can use to learn about |
| 282 | Android, load as a project and run, or reuse in your own app. Note that multiple |
| 283 | samples components are available — one for each Android platform version. When |
| 284 | you are choosing a samples component to download, select the one whose API Level |
| 285 | matches the API Level of the Android platform that you plan to use.</td> |
| 286 | </tr> |
| 287 | <tr> |
| 288 | <td>Usb Driver</td> |
| 289 | <td>The Usb Driver component is needed only if you are developing on Windows and |
| 290 | have an Android-powered device on which you want to install your application for |
| 291 | debugging and testing. For Mac OS X and Linux platforms, no |
| 292 | special driver is needed.</td> |
| 293 | </tr> |
| 294 | <tr> |
| 295 | <td colspan="3" style="border:none;text-align:center;font-size:1.5em;font-weight:bold;">+</td> |
| 296 | </tr> |
| 297 | <tr> |
| 298 | <td rowspan="3">Full</td> |
| 299 | <td>Google APIs</td> |
| 300 | <td>The Google APIs add-on gives your application access to the Maps external |
| 301 | library, which makes it easy to display and manipulate Maps data in your |
| 302 | application. </td> |
| 303 | </tr> |
| 304 | <tr> |
| 305 | <td>Additional SDK Platforms</td> |
| 306 | <td>If you plan to publish your application, you will want to download |
| 307 | additional platforms corresponding to the Android platform versions on which you |
| 308 | want the application to run. The recommended approach is to compile your |
| 309 | application against the lowest version you want to support, but test it against |
Dirk Dougherty | bf15ce6 | 2009-10-23 19:17:12 -0700 | [diff] [blame] | 310 | higher versions that you intend the application to run on. You can test your |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 311 | applications on different platforms by running in an Android Virtual Device |
| 312 | (AVD) on the Android emulator.</td> |
| 313 | </tr> |
| 314 | |
| 315 | </table> |
Dirk Dougherty | eeb0b25 | 2009-10-22 16:08:32 -0700 | [diff] [blame] | 316 | |
Dirk Dougherty | bf15ce6 | 2009-10-23 19:17:12 -0700 | [diff] [blame] | 317 | <p>For step-by-step instructions on how to use the Android SDK and AVD Manager |
| 318 | to add components, see the <a href="{@docRoot}sdk/adding-components.html">Adding |
| 319 | SDK Components</a> document. </p> |
| 320 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 321 | <p>For revision notes and other detailed information about individual SDK |
| 322 | components, see the documents listed under "Downloadable SDK Components" in |
Dirk Dougherty | bf15ce6 | 2009-10-23 19:17:12 -0700 | [diff] [blame] | 323 | the navigation at left.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 324 | |
| 325 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 326 | <h2 id="sdkContents">Step 5. Exploring the SDK</h2> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 327 | |
| 328 | <p>Once you've installed the SDK and downloaded the platforms, documentation, |
| 329 | and add-ons that you need, open the SDK directory and take a look at what's |
| 330 | inside.</p> |
| 331 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 332 | <p>The table below describes the full SDK directory contents, with components |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 333 | installed. </p> |
| 334 | |
| 335 | <table> |
| 336 | <tr> |
| 337 | <th colspan="3">Name</th><th>Description</th> |
| 338 | </tr> |
| 339 | <tr> |
| 340 | <td colspan="3"><code>add-ons/</code></td> |
| 341 | <td>Contains add-ons to the Android SDK development |
| 342 | environment, which let you develop against external libraries that are available on some |
| 343 | devices. </td> |
Scott Main | 081127b | 2010-10-29 15:56:27 -0700 | [diff] [blame^] | 344 | </tr>repo |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 345 | <tr> |
| 346 | <td colspan="3"><code>docs/</code></td> |
| 347 | <td>A full set of documentation in HTML format, including the Developer's Guide, |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 348 | API Reference, and other information. To read the documentation, load the |
Dirk Dougherty | eeb0b25 | 2009-10-22 16:08:32 -0700 | [diff] [blame] | 349 | file <code>offline.html</code> in a web browser.</td> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 350 | </tr> |
| 351 | <tr> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 352 | <td colspan="3"><code>platform-tools/</code></td> |
| 353 | <td>Contains development tools that may be updated with each platform release (from the <em>Android |
| 354 | SDK Platform-tools</em> component). Tools in here include {@code adb}, {@code dexdump}, and others |
| 355 | others that you don't typically use directly. These tools are separate from the generic development |
| 356 | tools in the {@code tools/} directory, because these tools may be updated in order to support new |
| 357 | features in the latest Android platform, whereas the other tools have no dependencies on the |
| 358 | platform version.</td> |
| 359 | </tr> |
| 360 | <tr> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 361 | <td colspan="3"><code>platforms/</code></td> |
| 362 | <td>Contains a set of Android platform versions that you can develop |
| 363 | applications against, each in a separate directory. </td> |
| 364 | </tr> |
| 365 | <tr> |
| 366 | <td style="width:2em;border-bottom-color:white;"></td> |
Scott Main | 0197999 | 2010-04-05 17:42:17 -0700 | [diff] [blame] | 367 | <td colspan="2"><code><em><platform></em>/</code></td> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 368 | <td>Platform version directory, for example "android-1.6". All platform version |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 369 | directories contain a similar set of files and subdirectory structure.</td> |
| 370 | </tr> |
| 371 | |
| 372 | <tr> |
| 373 | <td style="width:2em;border-bottom-color:white;"> </td> |
| 374 | <td style="width:2em;border-bottom-color:white;"></td> |
| 375 | <td><code>data/</code></td> |
| 376 | <td>Storage area for default fonts and resource definitions.</td> |
| 377 | </tr> |
| 378 | <tr> |
| 379 | <td style="width:2em;border-bottom-color:white;"></td> |
| 380 | <td style="width:2em;border-bottom-color:white;"></td> |
| 381 | <td><code>images/</code></td> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 382 | <td>Storage area for default disk images, including the Android system image, |
| 383 | the default userdata image, the default ramdisk image, and more. The images |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 384 | are used in emulator sessions.</td> |
| 385 | </tr> |
| 386 | <tr> |
| 387 | <td style="width:2em;border-bottom-color:white;"></td> |
| 388 | <td style="width:2em;border-bottom-color:white;"></td> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 389 | <td><code>skins/</code></td> |
| 390 | <td>A set of emulator skins available for the platform version. Each skin is |
| 391 | designed for a specific screen resolution.</td> |
| 392 | </tr> |
| 393 | <tr> |
| 394 | <td style="width:2em;border-bottom-color:white;"></td> |
| 395 | <td style="width:2em;border-bottom-color:white;"></td> |
| 396 | <td><code>templates/</code></td> |
| 397 | <td>Storage area for file templates used by the SDK development tools.</td> |
| 398 | </tr> |
| 399 | <tr> |
| 400 | <td style="width:2em;border-bottom-color:white;"></td> |
| 401 | <td style="width:2em;border-bottom-color:white;"></td> |
| 402 | <td><code>tools/</code></td> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 403 | <td>This directory is used only by SDK Tools r7 and below for development tools that are specific to |
| 404 | this platform version—it's not used by SDK Tools r8 and above.</td> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 405 | </tr> |
| 406 | <tr> |
| 407 | <td style="width:2em;"></td> |
| 408 | <td style="width:2em;"></td> |
| 409 | <td><code>android.jar</code></td> |
| 410 | <td>The Android library used when compiling applications against this platform |
| 411 | version.</td> |
| 412 | </tr> |
| 413 | <tr> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 414 | <td colspan="3"><code>samples/</code></td> |
| 415 | <td>Sample code and apps that are specific to platform version.</td> |
| 416 | </tr> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 417 | <td colspan="3"><code>tools/</code></td> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 418 | <td>Contains the set of development and profiling tools that are platform-independent, such |
| 419 | as the emulator, the AVD and SDK Manager, adb, ddms, hierarchyviewer and more. The tools in |
| 420 | this directory may be updated at any time (from the <em>Android SDK Tools</em> component), |
| 421 | independent of platform releases, whereas the tools in {@code platform-tools/} may be updated based |
| 422 | on the latest platform release.</td> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 423 | </tr> |
| 424 | <tr> |
Dirk Dougherty | eeb0b25 | 2009-10-22 16:08:32 -0700 | [diff] [blame] | 425 | <td colspan="3"><code>SDK Readme.txt</code></td> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 426 | <td>A file that explains how to perform the initial setup of your SDK, |
| 427 | including how to launch the Android SDK and AVD Manager tool on all |
Dirk Dougherty | eeb0b25 | 2009-10-22 16:08:32 -0700 | [diff] [blame] | 428 | platforms</td> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 429 | </tr> |
| 430 | <tr> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 431 | <td colspan="3"><code>SDK Manager.exe</code></td> |
| 432 | <td>Windows SDK only. A shortcut that launches the Android SDK and AVD |
Dirk Dougherty | eeb0b25 | 2009-10-22 16:08:32 -0700 | [diff] [blame] | 433 | Manager tool, which you use to add components to your SDK. </td> |
| 434 | </tr> |
| 435 | <!--<tr> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 436 | <td colspan="3"><code>documentation.html</code></td> |
| 437 | <td>A file that loads the entry page for the local Android SDK |
| 438 | documentation.</td> |
Dirk Dougherty | eeb0b25 | 2009-10-22 16:08:32 -0700 | [diff] [blame] | 439 | </tr>--> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 440 | |
| 441 | </table> |
| 442 | |
| 443 | <h2 id="NextSteps">Next Steps</h2> |
| 444 | <p>Once you have completed installation, you are ready to |
| 445 | begin developing applications. Here are a few ways you can get started: </p> |
| 446 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 447 | <p><strong>Set up the Hello World application</strong></p> |
| 448 | <ul> |
Scott Main | 0197999 | 2010-04-05 17:42:17 -0700 | [diff] [blame] | 449 | <li>If you have just installed the SDK for the first time, go to the <a |
| 450 | href="{@docRoot}resources/tutorials/hello-world.html">Hello |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 451 | World tutorial</a>. The tutorial takes you step-by-step through the process |
| 452 | of setting up your first Android project, including setting up an Android |
Scott Main | 0197999 | 2010-04-05 17:42:17 -0700 | [diff] [blame] | 453 | Virtual Device (AVD) on which to run the application. |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 454 | </li> |
| 455 | </ul> |
| 456 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 457 | <p class="caution">Following the Hello World tutorial is an essential |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 458 | first step in getting started with Android development. </p> |
| 459 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 460 | <p><strong>Learn about Android</strong></p> |
| 461 | <ul> |
| 462 | <li>Take a look at the <a href="{@docRoot}guide/index.html">Dev |
| 463 | Guide</a> and the types of information it provides</li> |
| 464 | <li>Read an introduction to Android as a platform in <a |
| 465 | href="{@docRoot}guide/basics/what-is-android.html">What is |
| 466 | Android?</a></li> |
| 467 | <li>Learn about the Android framework and how applications run on it in |
| 468 | <a href="{@docRoot}guide/topics/fundamentals.html">Application |
| 469 | Fundamentals</a></li> |
| 470 | <li>Take a look at the Android framework API specification in the <a |
| 471 | href="{@docRoot}reference/packages.html">Reference</a> tab</li> |
| 472 | </ul> |
| 473 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 474 | <p><strong>Explore the development tools</strong></p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 475 | <ul> |
| 476 | <li>Get an overview of the <a |
| 477 | href="{@docRoot}guide/developing/tools/index.html">development |
| 478 | tools</a> that are available to you</li> |
| 479 | <li>Read how to develop <a |
| 480 | href="{@docRoot}guide/developing/eclipse-adt.html">in Eclipse/ADT</a> or |
| 481 | <a href="{@docRoot}guide/developing/other-ide.html">in other IDEs</a> |
| 482 | </li> |
Scott Main | 0197999 | 2010-04-05 17:42:17 -0700 | [diff] [blame] | 483 | <li>Read <a href="{@docRoot}guide/developing/device.html">Developing on a Device</a> to set up an |
| 484 | Android-powered device to run and test your application.</li> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 485 | </ul> |
| 486 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 487 | <p><strong>Follow the Notepad tutorial</strong></p> |
| 488 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 489 | <ul> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 490 | <li>The <a href="{@docRoot}resources/tutorials/notepad/index.html"> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 491 | Notepad Tutorial</a> shows you how to build a full Android application |
| 492 | and provides helpful commentary on the Android system and API. The |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 493 | Notepad tutorial helps you bring together the important design |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 494 | and architectural concepts in a moderately complex application. |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 495 | </li> |
| 496 | </ul> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 497 | <p class="caution">Following the Notepad tutorial is an excellent |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 498 | second step in getting started with Android development. </p> |
| 499 | |
| 500 | <p><strong>Explore some code</strong></p> |
| 501 | |
| 502 | <ul> |
| 503 | <li>The Android SDK includes sample code and applications for each platform |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 504 | version. You can browse the samples in the <a |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 505 | href="{@docRoot}resources/index.html">Resources</a> tab or download them |
| 506 | into your SDK using the Android SDK and AVD Manager. Once you've downloaded the |
| 507 | samples, you'll find them in |
| 508 | <code><em><sdk></em>/samples/<em><platform>/</em></code>. </li> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 509 | </ul> |
| 510 | |
| 511 | <p><strong>Visit the Android developer groups</strong></p> |
| 512 | <ul> |
| 513 | <li>Take a look at the <a |
Dirk Dougherty | 22558d0 | 2009-12-10 16:25:06 -0800 | [diff] [blame] | 514 | href="{@docRoot}resources/community-groups.html">Community</a> pages to see a list of |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 515 | Android developers groups. In particular, you might want to look at the |
| 516 | <a href="http://groups.google.com/group/android-developers">Android |
| 517 | Developers</a> group to get a sense for what the Android developer |
| 518 | community is like.</li> |
| 519 | </ul> |
| 520 | |
Dirk Dougherty | 6b13bc0 | 2009-10-30 19:05:53 -0700 | [diff] [blame] | 521 | <h2 id="troubleshooting">Troubleshooting</h2> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 522 | |
| 523 | <h3>Ubuntu Linux Notes</h3> |
| 524 | |
| 525 | <ul> |
| 526 | <li>If you need help installing and configuring Java on your |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 527 | development machine, you might find these resources helpful: |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 528 | <ul> |
| 529 | <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/Java </a></li> |
| 530 | <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/JavaInstallation</a></li> |
| 531 | </ul> |
| 532 | </li> |
| 533 | <li>Here are the steps to install Java and Eclipse, prior to installing |
| 534 | the Android SDK and ADT Plugin. |
| 535 | <ol> |
| 536 | <li>If you are running a 64-bit distribution on your development |
| 537 | machine, you need to install the <code>ia32-libs</code> package using |
| 538 | <code>apt-get:</code>: |
| 539 | <pre>apt-get install ia32-libs</pre> |
| 540 | </li> |
Scott Main | ef4ca45 | 2010-04-12 16:05:49 -0700 | [diff] [blame] | 541 | <li>Next, install Java: <pre>apt-get install sun-java6-jdk</pre></li> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 542 | <li>The Ubuntu package manager does not currently offer an Eclipse 3.3 |
| 543 | version for download, so we recommend that you download Eclipse from |
| 544 | eclipse.org (<a |
| 545 | href="http://www.eclipse.org/downloads/">http://www.eclipse.org/ |
| 546 | downloads/</a>). A Java or RCP version of Eclipse is recommended.</li> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 547 | <li>Follow the steps given in previous sections to install the SDK |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 548 | and the ADT plugin. </li> |
| 549 | </ol> |
| 550 | </li> |
| 551 | </ul> |
| 552 | |
| 553 | <h3>Other Linux Notes</h3> |
| 554 | |
| 555 | <ul> |
| 556 | <li>If JDK is already installed on your development computer, please |
| 557 | take a moment to make sure that it meets the version requirements listed |
| 558 | in the <a href="requirements.html">System Requirements</a>. |
| 559 | In particular, note that some Linux distributions may include JDK 1.4 or Gnu |
| 560 | Compiler for Java, both of which are not supported for Android development.</li> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 561 | </ul> |