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