blob: 755f200fa641c4ef9291ad3c0dc88b4e9ef1c1cd [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
25<p>Adding and updating components in your Android SDK is fast and easy. To
26perform an update, use the <strong>Android SDK and AVD Manager</strong> to
27install or update the individual SDK components that you need. The Android SDK
Scott Main06cf15e2010-10-28 00:02:31 -070028and AVD Manager tool is included in the <a href="index.html">Android SDK
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070029download</a>.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070030
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070031<p>It only takes a couple of clicks to install individual versions of the
32Android platform, new development tools, new documentation, and SDK add-ons. The
33new SDK components are automatically installed into your existing SDK directory,
34so you don't need to update your development environment to specify a new SDK
35location.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070036
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070037<p>Because each version of the Android platform can be installed as an
38individual component of your SDK, you can customize your development environment
39to the Android platforms you are targetting. Testing your app on multiple
40versions of the platform is very important in order to successfully operate on
41as many devices as possible. Be sure to install each version of the Android
42platform with which your app is compatible, then test your apps on <a
43href="{@docRoot}guide/developing/tools/avd.html">AVDs</a> that run each
44platform.</p>
45
46<p>If you are just getting started and you are not sure what components to install,
47see <a href="installing.html#components">Adding Platforms and Other
48Components</a> for information. </p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -070049
50<p>If you develop applications using Eclipse, you may also need to update your
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070051ADT plugin when you update your development tools, in order to compile against
52a new version of the platform. See the revisions listed in the <a
53href="{@docRoot}sdk/tools-notes.html">SDK Tools</a> document for ADT
54Plugin compatibility.</p>
55
Scott Main06cf15e2010-10-28 00:02:31 -070056<div style="TEXT-ALIGN:left; width:600px;">
57<img src="{@docRoot}images/sdk_manager_packages.png"
58style="padding-bottom:0;margin-bottom:0;" />
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070059<p class="caption" style="margin:0 0 1.5em 1em;padding:0 0 0
Scott Main06cf15e2010-10-28 00:02:31 -0700601em;"><strong>Figure 1.</strong> The Android SDK and AVD Manager's
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070061<strong>Available Packages</strong>
62panel, which shows the SDK components that are
63available for you to download into your environment. </p>
Scott Main06cf15e2010-10-28 00:02:31 -070064</div>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070065
66<h2 id="launching">Launching the Android SDK and AVD Manager</h2>
67
Scott Main06cf15e2010-10-28 00:02:31 -070068<p>The Android SDK and AVD Manager is the tool that you use to install and
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070069upgrade SDK components in your development environment. </p>
70
71<p>You can access the tool in any of three ways:</p>
72<ul>
73<li>If you are developing in the Eclipse IDE with the ADT Plugin, you can access
74the tool directly from the Eclipse UI.</li>
75<li>On Windows only, you can launch he tool by double-clicking a script file.</li>
76<li>In all environments, you can access the tool from a command line.</li>
77</ul>
78
79<h4>Launching from Eclipse/ADT</h4>
80
81<p>If you are developing in Eclipse and have already installed the ADT Plugin,
82follow these steps to access the Android SDK and AVD Manager tool:</p>
83
84<ol>
85<li>Open Eclipse</li>
Scott Main06cf15e2010-10-28 00:02:31 -070086<li>Select <strong>Window</strong> &gt; <strong>Android SDK and AVD
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070087Manager</strong>.</li>
88</ol>
89
Scott Main06cf15e2010-10-28 00:02:31 -070090<h4>Launching from the SDK Manager script (Windows only)</h4>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070091
92<p>For Windows only, the SDK includes a script that invokes the Android SDK and
Scott Main06cf15e2010-10-28 00:02:31 -070093AVD Manager. To launch the tool using the script, double-click {@code SDK
94Manager.exe} at the root of the the SDK directory.</p>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070095
96<h4>Launching from a command line</h4>
97
98<p>In all development environments, follow these steps to access the Android SDK
99and AVD Manager tool from the command line: </p>
100
101<ol>
102<li>Navigate to the <code>&lt;<em>sdk</em>&gt;/tools/</code> directory.</li>
Scott Main06cf15e2010-10-28 00:02:31 -0700103<li>Execute the {@code android} tool command with no options.
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700104 <pre style="width:400px">$ android</pre></li>
105</ol>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700106
107
108<h2 id="InstallingComponents">Installing SDK Components</h2>
109
Scott Main06cf15e2010-10-28 00:02:31 -0700110<p class="caution"><strong>Caution:</strong> Before you install SDK components,
111we recommend that you disable any antivirus software that may be running on
112your computer. There are cases in which antivirus software on Windows is known to interfere with the
113installation process, so we suggest you disable your antivirus until installation is
114complete.</p>
Dirk Doughertya374f512009-11-09 11:41:09 -0800115
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700116<p>Follow these steps to install new SDK components in your environment:</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700117
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700118<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700119 <li>Launch the Android SDK and AVD Manager as described in the section above.</li>
120 <li>Select <strong>Available Packages</strong> in the left panel.
Scott Main06cf15e2010-10-28 00:02:31 -0700121 This will reveal all of the components that are currently available for download
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700122 from the SDK repository.</li>
123 <li>Select the component(s) you'd like to install and click <strong>Install
Scott Main06cf15e2010-10-28 00:02:31 -0700124 Selected</strong>. If you aren't sure which packages to select, read <a
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700125 href="installing.html#which">Which components do I need?</a>.</li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700126 <li>Verify and accept the components you want and click <strong>Install
127 Accepted</strong>. The components will now be installed into your existing
128 Android SDK directories.</li>
129</ol>
130
Scott Main06cf15e2010-10-28 00:02:31 -0700131<p>New platforms are automatically saved into the
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700132<code>&lt;<em>sdk</em>&gt;/platforms/</code> directory of your SDK;
133new add-ons are saved in the <code>&lt;<em>sdk</em>&gt;/add-ons/</code>
Scott Main06cf15e2010-10-28 00:02:31 -0700134directory; samples are saved in the
135<code>&lt;<em>sdk</em>&gt;/samples/android-&lt;<em>level</em>&gt;/</code>;
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700136and new documentation is saved in the existing
137<code>&lt;<em>sdk</em>&gt;/docs/</code> directory (old docs are replaced).</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700138
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700139
140<h2 id="UpdatingComponents">Updating SDK Components</h2>
141
142<p>From time to time, new revisions of existing SDK components are released and
143made available to you through the SDK repository. In most cases, if you have those
144components installed in your environment, you will want
145to download the new revisions as soon as possible. </p>
146
147<p>You can learn about the release of new revisions in two ways: </p>
148
149<ul>
150<li>You can watch for updates listed in the "SDK" tab of the Android Developers
151site, in the "Downloadable SDK Components" section. </li>
152<li>You can watch for updates listed in the <strong>Available Packages</strong>
153panel of the Android SDK and AVD Manager. </li>
154</ul>
155
156<p>When you see that a new revision is available, you can use the Android SDK
157and AVD Manager to quickly download it to your environment. Follow the same
158procedure as given in <a href="">Installing SDK Components</a>, above. The new
159component is installed in place of the old, but without impacting your
160applications. </p>
161
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700162<p class="note"><strong>Tip:</strong>
163Use the "Display updates only" checkbox to show only the components
164you do not have.</p>
165
166
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700167<h2 id="dependencies">SDK Component Dependencies</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700168
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700169<p>In some cases, an SDK component may require a specific minimum revision of
170another component or SDK tool. Where such dependencies exist, they are
171documented in the revision notes for each component, available from the links in
172the "Downloadable SDK Components" section at left.</p>
173
174<p>For example, there may be a dependency between the ADT Plugin for Eclipse and
175the SDK Tools component. When you install the SDK Tools
176component, you would then need to upgrade to the required version of ADT (if you
177are developing in Eclipse). In this case, you would find dependencies listed in
178"Revisions" section of the <a href="{@docRoot}sdk/eclipse-adt.html#notes">ADT
179Plugin Notes</a> and <a href="{@docRoot}sdk/tools-notes.html#notes">SDK Tools
180Notes</a> documents. </p>
181
182<p>Additionally, the development tools will notify you with debug warnings
183if there is dependency that you need to address. </p>
184
185
186<h2 id="AddingSites">Adding New Sites</h2>
187
188<p>By default, <strong>Available Packages</strong> only shows the default
Scott Main06cf15e2010-10-28 00:02:31 -0700189repository site, which offers platforms, SDK tools, documentation, the
190Google APIs Add-on, and other components. You can add other sites that host
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700191their own Android SDK add-ons, then download the SDK add-ons
Scott Main06cf15e2010-10-28 00:02:31 -0700192from those sites.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700193
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700194<p>For example, a mobile carrier or device manufacturer might offer additional
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700195API libraries that are supported by their own Android-powered devices. In order
196to develop using their libraries, you must install their Android SDK add-on. </p>
197
198<p>If a carrier or device manufacturer has hosted an SDK add-on repository file
199on their web site, follow these steps to add their site to the SDK and AVD
200Manager:</p>
201
202<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700203 <li>Select <strong>Available Packages</strong> in the left panel.</li>
Scott Main06cf15e2010-10-28 00:02:31 -0700204 <li>Click <strong>Add Site</strong> and enter the URL of the
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700205{@code repository.xml} file. Click <strong>OK</strong>.</li>
206</ol>
207<p>Any SDK components available from the site will now be listed under
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700208<strong>Available Packages</strong>.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700209
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700210<h2 id="troubleshooting">Troubleshooting</h2>
Dirk Dougherty83d09252010-01-12 17:54:25 -0800211
212<p><strong>Problems connecting to the SDK repository</strong></p>
213
214<p>If you are using the SDK and AVD Manager to download components and are encountering
215connection problems, try connecting over http, rather than https. To switch the
216protocol used by the SDK and AVD Manager, follow these steps: </p>
217
218<ol>
219 <li>With the Android SDK and AVD Manager window open, select "Settings" in the
220 left pane. </li>
221 <li>On the right, in the "Misc" section, check the checkbox labeled "Force
222 https://... sources to be fetched using http://..." </li>
223 <li>Click <strong>Save &amp; Apply</strong>.</li>
224</ol>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700225
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700226