blob: 63c577ea75b3c5852f9053be7de256f6d57f1dbf [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>
9 <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
Dirk Dougherty7b229ef2010-03-26 17:32:26 -070028and AVD Manager tool is included in the <a href="index.html">Android SDK
29download</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
56<div style="TEXT-ALIGN:left; width:600px;">
57<img src="{@docRoot}images/sdk_manager_packages.png"
58style="padding-bottom:0;margin-bottom:0;" />
59<p class="caption" style="margin:0 0 1.5em 1em;padding:0 0 0
601em;"><strong>Figure 1.</strong> The Android SDK and AVD Manager's
61<strong>Available Packages</strong>
62panel, which shows the SDK components that are
63available for you to download into your environment. </p>
64</div>
65
66<h2 id="launching">Launching the Android SDK and AVD Manager</h2>
67
68<p>The Android SDK and AVD Manager is the tool that you use to install and
69upgrade 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>
86<li>Select <strong>Window</strong> &gt; <strong>Android SDK and AVD
87Manager</strong>.</li>
88</ol>
89
90<h4>Launching from the setup script (Windows only)</h4>
91
92<p>For Windows only, the SDK includes a script that invokes the Android SDK and
93AVD Manager. To launch the tool using the script, double-click "SDK
94Setup.exe" at the root of the the SDK directory.</p>
95
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>
103<li>Execute the {@code android} tool command with no options.
104 <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
Dirk Doughertya374f512009-11-09 11:41:09 -0800110<p class="caution"><strong>Important:</strong> Before you install SDK components,
111we recommend that you disable any antivirus programs that may be running on
112your computer.</p>
113
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700114<p>Follow these steps to install new SDK components in your environment:</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700115
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700116<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700117 <li>Launch the Android SDK and AVD Manager as described in the section above.</li>
118 <li>Select <strong>Available Packages</strong> in the left panel.
119 This will reveal all of the components that are currently available for download
120 from the SDK repository.</li>
121 <li>Select the component(s) you'd like to install and click <strong>Install
122 Selected</strong>. If you aren't sure which packages to select, read <a
123 href="installing.html#which">Which components do I need?</a>.</li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700124 <li>Verify and accept the components you want and click <strong>Install
125 Accepted</strong>. The components will now be installed into your existing
126 Android SDK directories.</li>
127</ol>
128
129<p>New platforms are automatically saved into the
Dirk Dougherty0d1b0812010-04-07 17:05:16 -0700130<code>&lt;<em>sdk</em>&gt;/platforms/</code> directory of your SDK;
131new add-ons are saved in the <code>&lt;<em>sdk</em>&gt;/add-ons/</code>
132directory; samples are saved in the
133<code>&lt;<em>sdk</em>&gt;/samples/android-&lt;<em>level</em>&gt;/</code>;
134and new documentation is saved in the existing
135<code>&lt;<em>sdk</em>&gt;/docs/</code> directory (old docs are replaced).</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700136
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700137
138<h2 id="UpdatingComponents">Updating SDK Components</h2>
139
140<p>From time to time, new revisions of existing SDK components are released and
141made available to you through the SDK repository. In most cases, if you have those
142components installed in your environment, you will want
143to download the new revisions as soon as possible. </p>
144
145<p>You can learn about the release of new revisions in two ways: </p>
146
147<ul>
148<li>You can watch for updates listed in the "SDK" tab of the Android Developers
149site, in the "Downloadable SDK Components" section. </li>
150<li>You can watch for updates listed in the <strong>Available Packages</strong>
151panel of the Android SDK and AVD Manager. </li>
152</ul>
153
154<p>When you see that a new revision is available, you can use the Android SDK
155and AVD Manager to quickly download it to your environment. Follow the same
156procedure as given in <a href="">Installing SDK Components</a>, above. The new
157component is installed in place of the old, but without impacting your
158applications. </p>
159
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700160<p class="note"><strong>Tip:</strong>
161Use the "Display updates only" checkbox to show only the components
162you do not have.</p>
163
164
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700165<h2 id="dependencies">SDK Component Dependencies</h2>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700166
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700167<p>In some cases, an SDK component may require a specific minimum revision of
168another component or SDK tool. Where such dependencies exist, they are
169documented in the revision notes for each component, available from the links in
170the "Downloadable SDK Components" section at left.</p>
171
172<p>For example, there may be a dependency between the ADT Plugin for Eclipse and
173the SDK Tools component. When you install the SDK Tools
174component, you would then need to upgrade to the required version of ADT (if you
175are developing in Eclipse). In this case, you would find dependencies listed in
176"Revisions" section of the <a href="{@docRoot}sdk/eclipse-adt.html#notes">ADT
177Plugin Notes</a> and <a href="{@docRoot}sdk/tools-notes.html#notes">SDK Tools
178Notes</a> documents. </p>
179
180<p>Additionally, the development tools will notify you with debug warnings
181if there is dependency that you need to address. </p>
182
183
184<h2 id="AddingSites">Adding New Sites</h2>
185
186<p>By default, <strong>Available Packages</strong> only shows the default
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700187repository site, which offers platforms, SDK tools, documentation, the
188Google APIs Add-on, and other components. You can add other sites that host
189their own Android SDK add-ons, then download the SDK add-ons
190from those sites.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700191
Dirk Doughertyeeb0b252009-10-22 16:08:32 -0700192<p>For example, a mobile carrier or device manufacturer might offer additional
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700193API libraries that are supported by their own Android-powered devices. In order
194to develop using their libraries, you must install their Android SDK add-on. </p>
195
196<p>If a carrier or device manufacturer has hosted an SDK add-on repository file
197on their web site, follow these steps to add their site to the SDK and AVD
198Manager:</p>
199
200<ol>
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700201 <li>Select <strong>Available Packages</strong> in the left panel.</li>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700202 <li>Click <strong>Add Site</strong> and enter the URL of the
203{@code repository.xml} file. Click <strong>OK</strong>.</li>
204</ol>
205<p>Any SDK components available from the site will now be listed under
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700206<strong>Available Packages</strong>.</p>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700207
Dirk Dougherty7b229ef2010-03-26 17:32:26 -0700208<h2 id="troubleshooting">Troubleshooting</h2>
Dirk Dougherty83d09252010-01-12 17:54:25 -0800209
210<p><strong>Problems connecting to the SDK repository</strong></p>
211
212<p>If you are using the SDK and AVD Manager to download components and are encountering
213connection problems, try connecting over http, rather than https. To switch the
214protocol used by the SDK and AVD Manager, follow these steps: </p>
215
216<ol>
217 <li>With the Android SDK and AVD Manager window open, select "Settings" in the
218 left pane. </li>
219 <li>On the right, in the "Misc" section, check the checkbox labeled "Force
220 https://... sources to be fetched using http://..." </li>
221 <li>Click <strong>Save &amp; Apply</strong>.</li>
222</ol>
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700223
Dirk Doughertyee58d1b2009-10-16 15:25:15 -0700224