blob: a1080c2c1a67b5b31c3200be97c8b0f04a31ac9d [file] [log] [blame]
Dirk Dougherty7b229ef2010-03-26 17:32:26 -07001page.title=Installing the SDK
Dirk Doughertyee58d1b2009-10-16 15:25:15 -07002
3@jd:body
4
Scott Main38dea272010-11-01 13:03:25 -07005
6<script type="text/javascript">
7function toggleDiv(link) {
8 var toggleable = $(link).parent();
9 if (toggleable.hasClass("closed")) {
10 //$(".toggleme", toggleable).slideDown("fast");
11 toggleable.removeClass("closed");
12 toggleable.addClass("open");
13 $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot +
14"assets/images/triangle-opened.png"));
15 } else {
16 //$(".toggleme", toggleable).slideUp("fast");
17 toggleable.removeClass("open");
18 toggleable.addClass("closed");
19 $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot +
20"assets/images/triangle-closed.png"));
21 }
22 return false;
23}
24</script>
25<style>
26.toggleable {
27 padding: .25em 1em 0em 1em;
28 margin-bottom: 0;
29}
30.toggleme {
31 padding: 1em 1em 0 2em;
32 line-height:1em;
33}
34.toggleable a {
35 text-decoration:none;
36}
37.toggleme a {
38 text-decoration:underline;
39}
40.toggleable.closed .toggleme {
41 display:none;
42}
43#jd-content .toggle-img {
44 margin:0;
45}
46</style>
47
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070048<div id="qv-wrapper">
49<div id="qv">
50
51 <h2>In this document</h2>
52 <ol>
Scott Main081127b2010-10-29 15:56:27 -070053 <li><a href="#Preparing">1. Preparing Your Development Computer</a></li>
54 <li><a href="#Installing">2. Downloading the SDK Starter Package</a></li>
55 <li><a href="#InstallingADT">3. Installing the ADT Plugin for Eclipse</a></li>
Scott Main369c1c12010-12-07 11:17:00 -080056 <li><a href="#AddingComponents">4. Adding Platforms and Other Components</a>
Scott Main38dea272010-11-01 13:03:25 -070057 <ol>
Scott Main4fb51ca2010-11-09 14:47:15 -080058 <li><a href="#components">Available Components</a></li>
Scott Main38dea272010-11-01 13:03:25 -070059 <li><a href="#which">Recommended Components</a></li>
60 </ol></li>
Scott Main0a21f342010-11-08 12:06:26 -080061 <li><a href="#sdkContents">5. Exploring the SDK (Optional)</a></li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070062 <li><a href="#NextSteps">Next Steps</a></li>
63 <li><a href="#troubleshooting">Troubleshooting</a></li>
64 </ol>
65
66<h2>See also</h2>
67 <ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070068 <li><a href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin for Eclipse</a></li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070069 <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
70 </ol>
71
72</div>
73</div>
74
Scott Main06cf15e2010-10-28 00:02:31 -070075<p>This page describes how to install the Android SDK
Dirk Doughertya374f512009-11-09 11:41:09 -080076and set up your development environment for the first time.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070077
Scott Main06cf15e2010-10-28 00:02:31 -070078<p>If you encounter any problems during installation, see the
Dirk Doughertya250f0c2009-10-22 18:02:45 -070079<a href="#troubleshooting">Troubleshooting</a> section at the bottom of
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070080this page.</p>
81
82<h4>Updating?</h4>
83
Scott Main081127b2010-10-29 15:56:27 -070084<p>If you already have an Android SDK, use the <em>Android SDK and AVD Manager</em> tool to install
85updated tools and new Android platforms into your existing environment. For information about how to
86do that, see <a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070087
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070088
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070089<h2 id="Preparing">Step 1. Preparing Your Development Computer</h2>
90
91<p>Before getting started with the Android SDK, take a moment to confirm that
92your development computer meets the <a href="requirements.html">System
Scott Main081127b2010-10-29 15:56:27 -070093Requirements</a>. In particular, you might need to install the <a
94href="http://java.sun.com/javase/downloads/index.jsp">JDK</a>, if you don't have it already. </p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070095
96<p>If you will be developing in Eclipse with the Android Development
Scott Main081127b2010-10-29 15:56:27 -070097Tools (ADT) Plugin&mdash;the recommended path if you are new to
98Android&mdash;make sure that you have a suitable version of Eclipse
Robert Ly2a36cf42011-03-09 10:33:20 -080099installed on your computer as described in the
100<a href="requirements.html">System Requirements</a> document.
101If you need to install Eclipse, you can download it from this location: </p>
Scott Main06cf15e2010-10-28 00:02:31 -0700102
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700103<p style="margin-left:2em;"><a href=
Scott Main06cf15e2010-10-28 00:02:31 -0700104"http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a></p>
105
Robert Ly2a36cf42011-03-09 10:33:20 -0800106<p>The "Eclipse Classic" version is recommended. Otherwise, a Java or
Scott Main081127b2010-10-29 15:56:27 -0700107RCP version of Eclipse is recommended.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700108
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700109
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700110<h2 id="Installing">Step 2. Downloading the SDK Starter Package</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700111
Scott Main38dea272010-11-01 13:03:25 -0700112<p>The SDK starter package is not a full
Scott Main081127b2010-10-29 15:56:27 -0700113development environment&mdash;it includes only the core SDK Tools, which you can
Scott Main38dea272010-11-01 13:03:25 -0700114use to download the rest of the SDK components (such as the latest Android platform).</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700115
Scott Main0a21f342010-11-08 12:06:26 -0800116<p>If you haven't already, get the latest version of the SDK starter package from the <a
Scott Main081127b2010-10-29 15:56:27 -0700117href="{@docRoot}sdk/index.html">SDK download page</a>.</p>
118
119<p>If you downloaded a {@code .zip} or {@code .tgz} package (instead of the SDK installer), unpack
120it to a safe location on your machine. By default, the SDK files are unpacked
121into a directory named <code>android-sdk-&lt;machine-platform&gt;</code>.</p>
Scott Main06cf15e2010-10-28 00:02:31 -0700122
Scott Main4fb51ca2010-11-09 14:47:15 -0800123<p>If you downloaded the Windows installer ({@code .exe} file), run it now and it will check
124whether the proper Java SE Development Kit (JDK) is installed (installing it, if necessary), then
125install the SDK Tools into a default location (which you can modify).</p>
126
127<p>Make a note of the name and location of the SDK directory on your system&mdash;you will need to
Scott Main06cf15e2010-10-28 00:02:31 -0700128refer to the SDK directory later, when setting up the ADT plugin and when using
129the SDK tools from command line.</p>
130
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700131
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700132<h2 id="InstallingADT">Step 3. Installing the ADT Plugin for Eclipse</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700133
134<p>Android offers a custom plugin for the Eclipse IDE, called Android
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700135Development Tools (ADT), that is designed to give you a powerful, integrated
136environment in which to build Android applications. It extends the capabilites
137of Eclipse to let you quickly set up new Android projects, create an application
Scott Main081127b2010-10-29 15:56:27 -0700138UI, debug your applications
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700139using the Android SDK tools, and even export signed (or unsigned) APKs in order
140to distribute your application. In general, developing in Eclipse with ADT is a
141highly recommended approach and is the fastest way to get started with Android.
142</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700143
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700144<p>If you'd like to use ADT for developing Android applications, install it now.
Scott Main081127b2010-10-29 15:56:27 -0700145Read <a href="{@docRoot}sdk/eclipse-adt.html#installing">Installing the ADT Plugin</a> for
146step-by-step installation instructions, then return here to continue the
147last step in setting up your Android SDK.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700148
Scott Main38dea272010-11-01 13:03:25 -0700149<p>If you prefer to work in a different IDE, you do not need to
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700150install Eclipse or ADT, instead, you can directly use the SDK tools to build and
Robert Lyc74a69a82011-01-04 22:48:02 -0800151debug your application. The <a href="{@docRoot}guide/developing/index.html">Overview</a>
Joe Malin2e3e3df2011-02-02 14:51:23 -0800152section of the developer guide outlines the major steps that you need to complete
Robert Lyc74a69a82011-01-04 22:48:02 -0800153when developing in Eclipse or other IDEs.</p>
Scott Main38dea272010-11-01 13:03:25 -0700154
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700155
Dirk Doughertybf15ce62009-10-23 19:17:12 -0700156
Scott Main369c1c12010-12-07 11:17:00 -0800157<h2 id="AddingComponents">Step 4. Adding Platforms and Other Components</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700158
Scott Main081127b2010-10-29 15:56:27 -0700159<p>The last step in setting up your SDK is using the <em>Android SDK and AVD Manager</em> (a
160tool included in the SDK starter package) to download
161essential SDK components into your development environment.</p>
Dirk Doughertybf15ce62009-10-23 19:17:12 -0700162
Scott Main081127b2010-10-29 15:56:27 -0700163<p>The SDK uses a modular structure that separates the major parts of the SDK&mdash;Android platform
164versions, add-ons, tools, samples, and documentation&mdash;into a set of separately installable
165components. The SDK starter package, which you've already downloaded, includes only a single
Scott Main38dea272010-11-01 13:03:25 -0700166component: the latest version of the SDK Tools. To develop an Android
167application, you also need to download at least one Android platform and the SDK Platform-tools
168(tools that the latest platform depend upon). However, downloading
169additional components is highly recommended.</p>
170
Scott Main4fb51ca2010-11-09 14:47:15 -0800171<p>If you used the Windows installer, when you complete the installation wizard, it will launch the
172Android SDK and AVD Manager with a default set of platforms and other components selected
173for you to install. Simply click <strong>Install</strong> to accept the recommended set of
174components and install them. You can then skip to <a href="#sdkContents">Step 5</a>, but we
175recommend you first read the section about the <a href="#components">Available Components</a> to
176better understand the components available from the Android SDK and AVD Manager.</p>
177
Scott Main38dea272010-11-01 13:03:25 -0700178<p>You can launch the Android SDK and AVD Manager in one of the following ways:</p>
179<ul>
180 <li>From within Eclipse, select <strong>Window &gt; Android SDK and AVD Manager</strong>.</li>
Joe Malin2e3e3df2011-02-02 14:51:23 -0800181 <li>On Windows, double-click the <code>SDK Manager.exe</code> file at the root of the Android
Scott Main38dea272010-11-01 13:03:25 -0700182SDK directory.</li>
183 <li>On Mac or Linux, open a terminal and navigate to the <code>tools/</code> directory in the
Scott Main4fb51ca2010-11-09 14:47:15 -0800184Android SDK, then execute: <pre>android</pre> </li>
Scott Main38dea272010-11-01 13:03:25 -0700185</ul>
186
187<p>To download components, use the graphical UI of the Android SDK and AVD
188Manager, shown in Figure 1, to browse the SDK repository and select new or updated
189components. The Android SDK and AVD Manager will install the selected components in
190your SDK environment. For information about which components you should download, see the following
Scott Main4fb51ca2010-11-09 14:47:15 -0800191section about <a href="#which">Recommended Components</a>.</p>
Scott Main38dea272010-11-01 13:03:25 -0700192
193<img src="/images/sdk_manager_packages.png" />
194<p class="img-caption"><strong>Figure 1.</strong> The Android SDK and AVD Manager's
195<strong>Available Packages</strong> panel, which shows the SDK components that are
196available for you to download into your environment.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700197
Scott Main4fb51ca2010-11-09 14:47:15 -0800198
199<h3 id="components">Available Components</h3>
200
201<p>By default, there are two repositories of components for your SDK: <em>Android
202Repository</em> and <em>Third party Add-ons</em>.</p>
203
204<p>The <em>Android Repository</em> offers these types of components:</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700205
206<ul>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700207<li><strong>SDK Tools</strong> (pre-installed in the Android SDK starter
Scott Main38dea272010-11-01 13:03:25 -0700208package) &mdash; Contains tools for debugging
209and testing your application and other utility tools. You can access these
210in the <code>&lt;sdk&gt;/tools/</code> directory of your SDK and read more about them in the <a
211href="{@docRoot}guide/developing/tools/index.html">Tools</a> section of the developer guide. </li>
212
213<li><strong>SDK Platform-tools</strong> &mdash; Contains tools that are required to develop and
214debug your application, but which are developed alongside the Android platform in order to support
215the latest features. These tools are typically updated only when a new platform becomes
216available. You can access these
217in the <code>&lt;sdk&gt;/platform-tools/</code> directory. Read more about them in
218the <a href="{@docRoot}guide/developing/tools/index.html">Tools</a> section of the developer guide.
219</li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700220
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700221<li><strong>Android platforms</strong> &mdash; An SDK platform is
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700222available for every production Android platform deployable to Android-powered
223devices. Each platform component includes a fully compliant Android library and
224system image, sample code, emulator skins, and any version specific tools. For
225detailed information about each platform, see the overview documents available
226under the section "Downloadable SDK Components," at left. </li>
227
Scott Main4fb51ca2010-11-09 14:47:15 -0800228<li><strong>USB Driver for Windows</strong> (Windows only) &mdash; Contains driver files
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700229that you can install on your Windows computer, so that you can run and debug
230your applications on an actual device. You <em>do not</em> need the USB driver unless
231you plan to debug your application on an actual Android-powered device. If you
Scott Main06cf15e2010-10-28 00:02:31 -0700232develop on Mac OS X or Linux, you do not need a special driver to debug
Scott Main4fb51ca2010-11-09 14:47:15 -0800233your application on an Android-powered device. (See <a
234href="{@docRoot}guide/developing/device.html">Developing on a Device</a> for more information
235about developing on a real device.)</li>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700236
237<li><strong>Samples</strong> &mdash; Contains the sample code and apps available
238for each Android development platform. If you are just getting started with
239Android development, make sure to download the samples to your SDK. <!--The download
240includes not only a set of very useful sample apps, but also the source for <a
241href="{@docRoot}resources/tutorials/hello-world.html">Hello World</a> and other
242tutorials. --></li>
243
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700244<li><strong>Documentation</strong> &mdash; Contains a local copy of the latest
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700245multiversion documentation for the Android framework API. </li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700246</ul>
247
Scott Main4fb51ca2010-11-09 14:47:15 -0800248<p>The <em>Third party Add-ons</em> provide components that allow you to create a development
249environment using a specific Android external library (such as the Google Maps library) or a
250customized (but fully compliant) Android system image. You can add additional Add-on repositories,
251by clicking <strong>Add Add-on Site</strong>.</p>
252
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700253
Scott Main38dea272010-11-01 13:03:25 -0700254<h3 id="which">Recommended Components</h3>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700255
256<p>The SDK repository contains a range of components that you can download.
257Use the table below to determine which components you need, based on whether you
Scott Main38dea272010-11-01 13:03:25 -0700258want to set up a basic, recommended, or full development environment:
259</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700260
261<table style="width:95%">
262
263<tr>
264<th>Environment</th>
265<th>SDK&nbsp;Component</th>
266<th>Comments</th>
267</tr>
268
269<tr>
Scott Main38dea272010-11-01 13:03:25 -0700270<td rowspan="3" style="font-size:.9em;background-color:#FFE;">Basic</td>
271<td style="font-size:.9em;background-color:#FFE;">SDK Tools</td>
272<td style="font-size:.9em;background-color:#FFE;">If you've just installed
273the SDK starter package, then you already have the latest version of this component. The
274SDK Tools component is required to develop an Android application. Make sure you keep this up to
275date.</td>
276</tr>
277
278<tr>
279<td style="font-size:.9em;background-color:#FFE;">SDK Platform-tools</td>
280<td style="font-size:.9em;background-color:#FFE;">This includes more tools that are required
281for application development. These tools are platform-dependent and typically update only when
282a new SDK platform is made available, in order to support new features in the platform. These
283tools are always backward compatible with older platforms, but you must be sure that you have
284the latest version of these tools when you install a new SDK platform.</td>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700285</tr>
286
287<tr>
288<td style="font-size:.9em;background-color:#FFE;">SDK platform</td>
289<td style="font-size:.9em;background-color:#FFE;">You need to download <strong
290style="color:red">at least one platform</strong> into your environment, so that
291you will be able to compile your application and set up an Android Virtual
292Device (AVD) to run it on (in the emulator). To start with, just download the
293latest version of the platform. Later, if you plan to publish your application,
294you will want to download other platforms as well, so that you can test your
Scott Main38dea272010-11-01 13:03:25 -0700295application on the full range of Android platform versions that your application supports.</td>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700296</tr>
297<tr>
Scott Main38dea272010-11-01 13:03:25 -0700298<td colspan="2"
299style="border:none;text-align:center;font-size:1.5em;font-weight:bold;">+</td><td
300style="border:none"></td>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700301</tr>
302<tr>
Scott Main38dea272010-11-01 13:03:25 -0700303<td rowspan="3">Recommended<br/>(plus Basic)</td>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700304<td>Documentation</td>
305<td>The Documentation component is useful because it lets you work offline and
306also look up API reference information from inside Eclipse.</td>
307</tr>
308
309<tr>
310<td>Samples</td>
311<td>The Samples components give you source code that you can use to learn about
312Android, load as a project and run, or reuse in your own app. Note that multiple
313samples components are available &mdash; one for each Android platform version. When
314you are choosing a samples component to download, select the one whose API Level
315matches the API Level of the Android platform that you plan to use.</td>
316</tr>
317<tr>
318<td>Usb Driver</td>
319<td>The Usb Driver component is needed only if you are developing on Windows and
320have an Android-powered device on which you want to install your application for
321debugging and testing. For Mac OS X and Linux platforms, no
322special driver is needed.</td>
323</tr>
324<tr>
Scott Main38dea272010-11-01 13:03:25 -0700325<td colspan="2"
326style="border:none;text-align:center;font-size:1.5em;font-weight:bold;">+</td><td
327style="border:none"></td>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700328</tr>
329<tr>
Scott Main38dea272010-11-01 13:03:25 -0700330<td rowspan="3">Full<br/>(plus Recommended)</td>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700331<td>Google APIs</td>
332<td>The Google APIs add-on gives your application access to the Maps external
333library, which makes it easy to display and manipulate Maps data in your
334application. </td>
335</tr>
336<tr>
337<td>Additional SDK Platforms</td>
338<td>If you plan to publish your application, you will want to download
339additional platforms corresponding to the Android platform versions on which you
340want the application to run. The recommended approach is to compile your
341application against the lowest version you want to support, but test it against
Dirk Doughertybf15ce62009-10-23 19:17:12 -0700342higher versions that you intend the application to run on. You can test your
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700343applications on different platforms by running in an Android Virtual Device
344(AVD) on the Android emulator.</td>
345</tr>
346
347</table>
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700348
Scott Main38dea272010-11-01 13:03:25 -0700349<p>Once you've installed at least the basic configuration of SDK components, you're ready to start
350developing Android apps. The next section describes the contents of the Android SDK to familiarize
351you with the components you've just installed.</p>
Dirk Doughertybf15ce62009-10-23 19:17:12 -0700352
Scott Main38dea272010-11-01 13:03:25 -0700353<p>For more information about using the Android SDK and AVD Manager, see the <a
354href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a> document. </p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700355
356
Scott Main0a21f342010-11-08 12:06:26 -0800357<h2 id="sdkContents">Step 5. Exploring the SDK (Optional)</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700358
359<p>Once you've installed the SDK and downloaded the platforms, documentation,
Scott Main0a21f342010-11-08 12:06:26 -0800360and add-ons that you need, we suggest that you open the SDK directory and take a look at what's
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700361inside.</p>
362
Scott Main06cf15e2010-10-28 00:02:31 -0700363<p>The table below describes the full SDK directory contents, with components
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700364installed. </p>
365
366<table>
367<tr>
368<th colspan="3">Name</th><th>Description</th>
369</tr>
370<tr>
371<td colspan="3"><code>add-ons/</code></td>
372<td>Contains add-ons to the Android SDK development
373environment, which let you develop against external libraries that are available on some
374devices. </td>
Scott Main38dea272010-11-01 13:03:25 -0700375</tr>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700376<tr>
377<td colspan="3"><code>docs/</code></td>
378<td>A full set of documentation in HTML format, including the Developer's Guide,
Scott Main06cf15e2010-10-28 00:02:31 -0700379API Reference, and other information. To read the documentation, load the
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700380file <code>offline.html</code> in a web browser.</td>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700381</tr>
382<tr>
Scott Main06cf15e2010-10-28 00:02:31 -0700383<td colspan="3"><code>platform-tools/</code></td>
384<td>Contains development tools that may be updated with each platform release (from the <em>Android
385SDK Platform-tools</em> component). Tools in here include {@code adb}, {@code dexdump}, and others
386others that you don't typically use directly. These tools are separate from the generic development
387tools in the {@code tools/} directory, because these tools may be updated in order to support new
388features in the latest Android platform, whereas the other tools have no dependencies on the
389platform version.</td>
390</tr>
391<tr>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700392<td colspan="3"><code>platforms/</code></td>
393<td>Contains a set of Android platform versions that you can develop
394applications against, each in a separate directory. </td>
395</tr>
396<tr>
397<td style="width:2em;border-bottom-color:white;"></td>
Scott Main01979992010-04-05 17:42:17 -0700398<td colspan="2"><code><em>&lt;platform&gt;</em>/</code></td>
Scott Main06cf15e2010-10-28 00:02:31 -0700399<td>Platform version directory, for example "android-1.6". All platform version
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700400directories contain a similar set of files and subdirectory structure.</td>
401</tr>
402
403<tr>
404<td style="width:2em;border-bottom-color:white;">&nbsp;</td>
405<td style="width:2em;border-bottom-color:white;"></td>
406<td><code>data/</code></td>
407<td>Storage area for default fonts and resource definitions.</td>
408</tr>
409<tr>
410<td style="width:2em;border-bottom-color:white;"></td>
411<td style="width:2em;border-bottom-color:white;"></td>
412<td><code>images/</code></td>
Scott Main06cf15e2010-10-28 00:02:31 -0700413<td>Storage area for default disk images, including the Android system image,
414the default userdata image, the default ramdisk image, and more. The images
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700415are used in emulator sessions.</td>
416</tr>
417<tr>
418<td style="width:2em;border-bottom-color:white;"></td>
419<td style="width:2em;border-bottom-color:white;"></td>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700420<td><code>skins/</code></td>
421<td>A set of emulator skins available for the platform version. Each skin is
422designed for a specific screen resolution.</td>
423</tr>
424<tr>
425<td style="width:2em;border-bottom-color:white;"></td>
426<td style="width:2em;border-bottom-color:white;"></td>
427<td><code>templates/</code></td>
428<td>Storage area for file templates used by the SDK development tools.</td>
429</tr>
430<tr>
431<td style="width:2em;border-bottom-color:white;"></td>
432<td style="width:2em;border-bottom-color:white;"></td>
433<td><code>tools/</code></td>
Scott Main06cf15e2010-10-28 00:02:31 -0700434<td>This directory is used only by SDK Tools r7 and below for development tools that are specific to
435this platform version&mdash;it's not used by SDK Tools r8 and above.</td>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700436</tr>
437<tr>
438<td style="width:2em;"></td>
439<td style="width:2em;"></td>
440<td><code>android.jar</code></td>
441<td>The Android library used when compiling applications against this platform
442version.</td>
443</tr>
444<tr>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700445<td colspan="3"><code>samples/</code></td>
446<td>Sample code and apps that are specific to platform version.</td>
447</tr>
Joe Malin2e3e3df2011-02-02 14:51:23 -0800448<tr>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700449<td colspan="3"><code>tools/</code></td>
Scott Main06cf15e2010-10-28 00:02:31 -0700450<td>Contains the set of development and profiling tools that are platform-independent, such
Scott Main3165bbb2010-12-16 10:26:23 -0800451as the emulator, the AVD and SDK Manager, ddms, hierarchyviewer and more. The tools in
Scott Main06cf15e2010-10-28 00:02:31 -0700452this directory may be updated at any time (from the <em>Android SDK Tools</em> component),
453independent of platform releases, whereas the tools in {@code platform-tools/} may be updated based
454on the latest platform release.</td>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700455</tr>
456<tr>
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700457<td colspan="3"><code>SDK Readme.txt</code></td>
Scott Main06cf15e2010-10-28 00:02:31 -0700458<td>A file that explains how to perform the initial setup of your SDK,
459including how to launch the Android SDK and AVD Manager tool on all
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700460platforms</td>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700461</tr>
462<tr>
Scott Main06cf15e2010-10-28 00:02:31 -0700463<td colspan="3"><code>SDK Manager.exe</code></td>
464<td>Windows SDK only. A shortcut that launches the Android SDK and AVD
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700465Manager tool, which you use to add components to your SDK. </td>
466</tr>
467<!--<tr>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700468<td colspan="3"><code>documentation.html</code></td>
469<td>A file that loads the entry page for the local Android SDK
470documentation.</td>
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700471</tr>-->
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700472
473</table>
474
Scott Main4fb51ca2010-11-09 14:47:15 -0800475
476<p>Optionally, you might want to add the location of the SDK's <code>tools/</code> and
477<code>platform-tools</code> to your <code>PATH</code> environment variable, to provide easy
478access to the tools.</p>
479
480
481<div class="toggleable closed">
482 <a href="#" onclick="return toggleDiv(this)">
483 <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
484width="9px" />
485 How to update your PATH</a>
486 <div class="toggleme">
487
488<p>Adding both <code>tools/</code> and <code>platform-tools/</code> to your PATH lets you run
489command line <a href="{@docRoot}guide/developing/tools/index.html">tools</a> without needing to
490supply the full path to the tool directories. Depending on your operating system, you can
491include these directories in your PATH in the following way:</p>
492
493<ul>
494
495 <li>On Windows, right-click on My Computer, and select Properties.
496 Under the Advanced tab, hit the Environment Variables button, and in the
497 dialog that comes up, double-click on Path (under System Variables). Add the full path to the
498 <code>tools/</code> and <code>platform-tools/</code> directories to the path. </li>
499
500 <li>On Linux, edit your <code>~/.bash_profile</code> or <code>~/.bashrc</code> file. Look
501 for a line that sets the PATH environment variable and add the
502 full path to the <code>tools/</code> and <code>platform-tools</code> directories to it. If you
503 don't see a line setting the path, you can add one:
504 <pre>export PATH=${PATH}:&lt;sdk&gt;/tools:&lt;sdk&gt;/platform-tools</pre>
505 </li>
506
507 <li>On a Mac OS X, look in your home directory for <code>.bash_profile</code> and
508 proceed as for Linux. You can create the <code>.bash_profile</code> if
509 you don't already have one. </li>
510</ul>
511
512</div><!-- end toggleme -->
513</div><!-- end toggleable -->
514
515
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700516<h2 id="NextSteps">Next Steps</h2>
517<p>Once you have completed installation, you are ready to
518begin developing applications. Here are a few ways you can get started: </p>
519
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700520<p><strong>Set up the Hello World application</strong></p>
521<ul>
Scott Main01979992010-04-05 17:42:17 -0700522 <li>If you have just installed the SDK for the first time, go to the <a
523 href="{@docRoot}resources/tutorials/hello-world.html">Hello
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700524 World tutorial</a>. The tutorial takes you step-by-step through the process
525 of setting up your first Android project, including setting up an Android
Scott Main01979992010-04-05 17:42:17 -0700526 Virtual Device (AVD) on which to run the application.
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700527</li>
528</ul>
529
Scott Main38dea272010-11-01 13:03:25 -0700530<p class="note">Following the Hello World tutorial is an essential
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700531first step in getting started with Android development. </p>
532
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700533<p><strong>Learn about Android</strong></p>
534<ul>
535 <li>Take a look at the <a href="{@docRoot}guide/index.html">Dev
536 Guide</a> and the types of information it provides</li>
537 <li>Read an introduction to Android as a platform in <a
538 href="{@docRoot}guide/basics/what-is-android.html">What is
539 Android?</a></li>
540 <li>Learn about the Android framework and how applications run on it in
541 <a href="{@docRoot}guide/topics/fundamentals.html">Application
542 Fundamentals</a></li>
543 <li>Take a look at the Android framework API specification in the <a
544 href="{@docRoot}reference/packages.html">Reference</a> tab</li>
545</ul>
546
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700547<p><strong>Explore the development tools</strong></p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700548<ul>
549 <li>Get an overview of the <a
550 href="{@docRoot}guide/developing/tools/index.html">development
551 tools</a> that are available to you</li>
Robert Lyc74a69a82011-01-04 22:48:02 -0800552 <li>Read the <a
Joe Malin2e3e3df2011-02-02 14:51:23 -0800553 href="{@docRoot}guide/developing/index.html">Overview</a>
Robert Lyc74a69a82011-01-04 22:48:02 -0800554 for how to develop an Android application.
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700555 </li>
Scott Main01979992010-04-05 17:42:17 -0700556 <li>Read <a href="{@docRoot}guide/developing/device.html">Developing on a Device</a> to set up an
557Android-powered device to run and test your application.</li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700558</ul>
559
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700560<p><strong>Follow the Notepad tutorial</strong></p>
561
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700562<ul>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700563 <li>The <a href="{@docRoot}resources/tutorials/notepad/index.html">
Scott Main06cf15e2010-10-28 00:02:31 -0700564 Notepad Tutorial</a> shows you how to build a full Android application
565 and provides helpful commentary on the Android system and API. The
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700566 Notepad tutorial helps you bring together the important design
Scott Main06cf15e2010-10-28 00:02:31 -0700567 and architectural concepts in a moderately complex application.
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700568 </li>
569</ul>
Scott Main38dea272010-11-01 13:03:25 -0700570<p class="note">Following the Notepad tutorial is an excellent
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700571second step in getting started with Android development. </p>
572
573<p><strong>Explore some code</strong></p>
574
575<ul>
576 <li>The Android SDK includes sample code and applications for each platform
Scott Main06cf15e2010-10-28 00:02:31 -0700577version. You can browse the samples in the <a
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700578href="{@docRoot}resources/index.html">Resources</a> tab or download them
579into your SDK using the Android SDK and AVD Manager. Once you've downloaded the
580samples, you'll find them in
581<code><em>&lt;sdk&gt;</em>/samples/<em>&lt;platform&gt;/</em></code>. </li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700582</ul>
583
584<p><strong>Visit the Android developer groups</strong></p>
585<ul>
586 <li>Take a look at the <a
Dirk Dougherty22558d02009-12-10 16:25:06 -0800587 href="{@docRoot}resources/community-groups.html">Community</a> pages to see a list of
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700588 Android developers groups. In particular, you might want to look at the
589 <a href="http://groups.google.com/group/android-developers">Android
590 Developers</a> group to get a sense for what the Android developer
591 community is like.</li>
592</ul>
593
Dirk Dougherty6b13bc02009-10-30 19:05:53 -0700594<h2 id="troubleshooting">Troubleshooting</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700595
596<h3>Ubuntu Linux Notes</h3>
597
598<ul>
599 <li>If you need help installing and configuring Java on your
Scott Main06cf15e2010-10-28 00:02:31 -0700600 development machine, you might find these resources helpful:
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700601 <ul>
602 <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/Java </a></li>
603 <li><a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/JavaInstallation</a></li>
604 </ul>
605 </li>
606 <li>Here are the steps to install Java and Eclipse, prior to installing
607 the Android SDK and ADT Plugin.
608 <ol>
609 <li>If you are running a 64-bit distribution on your development
610 machine, you need to install the <code>ia32-libs</code> package using
611 <code>apt-get:</code>:
612 <pre>apt-get install ia32-libs</pre>
613 </li>
Scott Mainef4ca452010-04-12 16:05:49 -0700614 <li>Next, install Java: <pre>apt-get install sun-java6-jdk</pre></li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700615 <li>The Ubuntu package manager does not currently offer an Eclipse 3.3
616 version for download, so we recommend that you download Eclipse from
617 eclipse.org (<a
618 href="http://www.eclipse.org/downloads/">http://www.eclipse.org/
619 downloads/</a>). A Java or RCP version of Eclipse is recommended.</li>
Scott Main06cf15e2010-10-28 00:02:31 -0700620 <li>Follow the steps given in previous sections to install the SDK
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700621 and the ADT plugin. </li>
622 </ol>
623 </li>
624</ul>
625
626<h3>Other Linux Notes</h3>
627
628<ul>
629 <li>If JDK is already installed on your development computer, please
630 take a moment to make sure that it meets the version requirements listed
631 in the <a href="requirements.html">System Requirements</a>.
632 In particular, note that some Linux distributions may include JDK 1.4 or Gnu
633 Compiler for Java, both of which are not supported for Android development.</li>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700634</ul>