blob: 05be0d6f8bd48ff1e5d457ace8393042ad6d2648 [file] [log] [blame]
Dirk Doughertyee58d1b2009-10-16 15:25:15 -07001page.title=Adding SDK Components
2@jd:body
3
4
5<div id="qv-wrapper">
6<div id="qv">
7<h2>Quickview</h2>
8<ul>
Scott Main06cf15e2010-10-28 00:02:31 -07009 <li>Use the Android SDK and AVD Manager to
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070010 set up your SDK and keep it up-to-date.</li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070011</ul>
12
13<h2>In this document</h2>
14<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070015 <li><a href="#launching">Launching the Android SDK and AVD Manager</a>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070016 <li><a href="#InstallingComponents">Installing SDK Components</a>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070017 <li><a href="#UpdatingComponents">Updating SDK Components</a>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070018 <li><a href="#dependencies">Component Dependencies</a></li>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070019 <li><a href="#AddingSites">Adding New Sites</a></li>
20 <li><a href="#troubleshooting">Troubleshooting</a></li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070021</ol>
22</div>
23</div>
24
Scott Main38dea272010-11-01 13:03:25 -070025<p>Adding and updating components in your Android SDK is fast and easy. To add or
26update the individual SDK components that you need, use the <em>Android SDK and AVD
27Manager</em> (included in the SDK Tools).</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070028
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070029<p>It only takes a couple of clicks to install individual versions of the
30Android platform, new development tools, new documentation, and SDK add-ons. The
31new SDK components are automatically installed into your existing SDK directory,
32so you don't need to update your development environment to specify a new SDK
33location.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070034
Scott Main38dea272010-11-01 13:03:25 -070035<p>If you're setting up your Android SDK for the first time,
36see <a href="{@docRoot}sdk/installing.html#components">Installing the SDK</a> for information about
37what components to install.</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070038
Scott Main38dea272010-11-01 13:03:25 -070039<p class="note"><strong>Note:</strong> If you develop in Eclipse, you might also need
40to update your ADT plugin when you update your development tools. See the revisions listed in the
41<a href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin for Eclipse</a> document.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070042
Scott Main38dea272010-11-01 13:03:25 -070043<img src="{@docRoot}images/sdk_manager_packages.png" alt="" />
44<p class="img-caption"><strong>Figure 1.</strong> The Android SDK and AVD Manager's
45<strong>Available Packages</strong> panel, which shows the SDK components that are
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070046available for you to download into your environment. </p>
Scott Main06cf15e2010-10-28 00:02:31 -070047</div>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070048
49<h2 id="launching">Launching the Android SDK and AVD Manager</h2>
50
Scott Main06cf15e2010-10-28 00:02:31 -070051<p>The Android SDK and AVD Manager is the tool that you use to install and
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070052upgrade SDK components in your development environment. </p>
53
Scott Main38dea272010-11-01 13:03:25 -070054<p>You can launch the Android SDK and AVD Manager in one of the following ways.</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070055
56<h4>Launching from Eclipse/ADT</h4>
57
58<p>If you are developing in Eclipse and have already installed the ADT Plugin,
59follow these steps to access the Android SDK and AVD Manager tool:</p>
60
61<ol>
62<li>Open Eclipse</li>
Scott Main06cf15e2010-10-28 00:02:31 -070063<li>Select <strong>Window</strong> &gt; <strong>Android SDK and AVD
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070064Manager</strong>.</li>
65</ol>
66
Scott Main06cf15e2010-10-28 00:02:31 -070067<h4>Launching from the SDK Manager script (Windows only)</h4>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070068
69<p>For Windows only, the SDK includes a script that invokes the Android SDK and
Scott Main06cf15e2010-10-28 00:02:31 -070070AVD Manager. To launch the tool using the script, double-click {@code SDK
71Manager.exe} at the root of the the SDK directory.</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070072
73<h4>Launching from a command line</h4>
74
75<p>In all development environments, follow these steps to access the Android SDK
76and AVD Manager tool from the command line: </p>
77
78<ol>
79<li>Navigate to the <code>&lt;<em>sdk</em>&gt;/tools/</code> directory.</li>
Scott Main06cf15e2010-10-28 00:02:31 -070080<li>Execute the {@code android} tool command with no options.
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070081 <pre style="width:400px">$ android</pre></li>
82</ol>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070083
84
85<h2 id="InstallingComponents">Installing SDK Components</h2>
86
Scott Main06cf15e2010-10-28 00:02:31 -070087<p class="caution"><strong>Caution:</strong> Before you install SDK components,
88we recommend that you disable any antivirus software that may be running on
89your computer. There are cases in which antivirus software on Windows is known to interfere with the
90installation process, so we suggest you disable your antivirus until installation is
91complete.</p>
Dirk Doughertya374f512009-11-09 11:41:09 -080092
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070093<p>Follow these steps to install new SDK components in your environment:</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070094
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070095<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070096 <li>Launch the Android SDK and AVD Manager as described in the section above.</li>
97 <li>Select <strong>Available Packages</strong> in the left panel.
Scott Main06cf15e2010-10-28 00:02:31 -070098 This will reveal all of the components that are currently available for download
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070099 from the SDK repository.</li>
100 <li>Select the component(s) you'd like to install and click <strong>Install
Scott Main06cf15e2010-10-28 00:02:31 -0700101 Selected</strong>. If you aren't sure which packages to select, read <a
Scott Main38dea272010-11-01 13:03:25 -0700102 href="installing.html#which">Recommended Components</a>.</li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700103 <li>Verify and accept the components you want and click <strong>Install
104 Accepted</strong>. The components will now be installed into your existing
105 Android SDK directories.</li>
106</ol>
107
Scott Main06cf15e2010-10-28 00:02:31 -0700108<p>New platforms are automatically saved into the
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700109<code>&lt;<em>sdk</em>&gt;/platforms/</code> directory of your SDK;
110new add-ons are saved in the <code>&lt;<em>sdk</em>&gt;/add-ons/</code>
Scott Main06cf15e2010-10-28 00:02:31 -0700111directory; samples are saved in the
112<code>&lt;<em>sdk</em>&gt;/samples/android-&lt;<em>level</em>&gt;/</code>;
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700113and new documentation is saved in the existing
114<code>&lt;<em>sdk</em>&gt;/docs/</code> directory (old docs are replaced).</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700115
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700116
117<h2 id="UpdatingComponents">Updating SDK Components</h2>
118
119<p>From time to time, new revisions of existing SDK components are released and
120made available to you through the SDK repository. In most cases, if you have those
121components installed in your environment, you will want
122to download the new revisions as soon as possible. </p>
123
124<p>You can learn about the release of new revisions in two ways: </p>
125
126<ul>
127<li>You can watch for updates listed in the "SDK" tab of the Android Developers
128site, in the "Downloadable SDK Components" section. </li>
129<li>You can watch for updates listed in the <strong>Available Packages</strong>
130panel of the Android SDK and AVD Manager. </li>
131</ul>
132
133<p>When you see that a new revision is available, you can use the Android SDK
134and AVD Manager to quickly download it to your environment. Follow the same
135procedure as given in <a href="">Installing SDK Components</a>, above. The new
136component is installed in place of the old, but without impacting your
137applications. </p>
138
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700139<p class="note"><strong>Tip:</strong>
140Use the "Display updates only" checkbox to show only the components
141you do not have.</p>
142
143
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700144<h2 id="dependencies">SDK Component Dependencies</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700145
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700146<p>In some cases, an SDK component may require a specific minimum revision of
147another component or SDK tool. Where such dependencies exist, they are
148documented in the revision notes for each component, available from the links in
149the "Downloadable SDK Components" section at left.</p>
150
151<p>For example, there may be a dependency between the ADT Plugin for Eclipse and
152the SDK Tools component. When you install the SDK Tools
153component, you would then need to upgrade to the required version of ADT (if you
154are developing in Eclipse). In this case, you would find dependencies listed in
155"Revisions" section of the <a href="{@docRoot}sdk/eclipse-adt.html#notes">ADT
156Plugin Notes</a> and <a href="{@docRoot}sdk/tools-notes.html#notes">SDK Tools
157Notes</a> documents. </p>
158
159<p>Additionally, the development tools will notify you with debug warnings
160if there is dependency that you need to address. </p>
161
162
163<h2 id="AddingSites">Adding New Sites</h2>
164
165<p>By default, <strong>Available Packages</strong> only shows the default
Scott Main06cf15e2010-10-28 00:02:31 -0700166repository site, which offers platforms, SDK tools, documentation, the
167Google APIs Add-on, and other components. You can add other sites that host
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700168their own Android SDK add-ons, then download the SDK add-ons
Scott Main06cf15e2010-10-28 00:02:31 -0700169from those sites.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700170
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700171<p>For example, a mobile carrier or device manufacturer might offer additional
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700172API libraries that are supported by their own Android-powered devices. In order
173to develop using their libraries, you must install their Android SDK add-on. </p>
174
175<p>If a carrier or device manufacturer has hosted an SDK add-on repository file
176on their web site, follow these steps to add their site to the SDK and AVD
177Manager:</p>
178
179<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700180 <li>Select <strong>Available Packages</strong> in the left panel.</li>
Scott Main06cf15e2010-10-28 00:02:31 -0700181 <li>Click <strong>Add Site</strong> and enter the URL of the
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700182{@code repository.xml} file. Click <strong>OK</strong>.</li>
183</ol>
184<p>Any SDK components available from the site will now be listed under
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700185<strong>Available Packages</strong>.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700186
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700187<h2 id="troubleshooting">Troubleshooting</h2>
Dirk Dougherty83d09252010-01-12 17:54:25 -0800188
189<p><strong>Problems connecting to the SDK repository</strong></p>
190
191<p>If you are using the SDK and AVD Manager to download components and are encountering
192connection problems, try connecting over http, rather than https. To switch the
193protocol used by the SDK and AVD Manager, follow these steps: </p>
194
195<ol>
196 <li>With the Android SDK and AVD Manager window open, select "Settings" in the
197 left pane. </li>
198 <li>On the right, in the "Misc" section, check the checkbox labeled "Force
199 https://... sources to be fetched using http://..." </li>
200 <li>Click <strong>Save &amp; Apply</strong>.</li>
201</ol>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700202
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700203