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