Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 1 | page.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 Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 9 | <li>Use the Android SDK and AVD Manager to |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 10 | set up your SDK and keep it up-to-date.</li> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 11 | </ul> |
| 12 | |
| 13 | <h2>In this document</h2> |
| 14 | <ol> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 15 | <li><a href="#launching">Launching the Android SDK and AVD Manager</a> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 16 | <li><a href="#InstallingComponents">Installing SDK Components</a> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 17 | <li><a href="#UpdatingComponents">Updating SDK Components</a> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 18 | <li><a href="#dependencies">Component Dependencies</a></li> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 19 | <li><a href="#AddingSites">Adding New Sites</a></li> |
| 20 | <li><a href="#troubleshooting">Troubleshooting</a></li> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 21 | </ol> |
| 22 | </div> |
| 23 | </div> |
| 24 | |
| 25 | <p>Adding and updating components in your Android SDK is fast and easy. To |
| 26 | perform an update, use the <strong>Android SDK and AVD Manager</strong> to |
| 27 | install or update the individual SDK components that you need. The Android SDK |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 28 | and AVD Manager tool is included in the <a href="index.html">Android SDK |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 29 | download</a>.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 30 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 31 | <p>It only takes a couple of clicks to install individual versions of the |
| 32 | Android platform, new development tools, new documentation, and SDK add-ons. The |
| 33 | new SDK components are automatically installed into your existing SDK directory, |
| 34 | so you don't need to update your development environment to specify a new SDK |
| 35 | location.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 36 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 37 | <p>Because each version of the Android platform can be installed as an |
| 38 | individual component of your SDK, you can customize your development environment |
| 39 | to the Android platforms you are targetting. Testing your app on multiple |
| 40 | versions of the platform is very important in order to successfully operate on |
| 41 | as many devices as possible. Be sure to install each version of the Android |
| 42 | platform with which your app is compatible, then test your apps on <a |
| 43 | href="{@docRoot}guide/developing/tools/avd.html">AVDs</a> that run each |
| 44 | platform.</p> |
| 45 | |
| 46 | <p>If you are just getting started and you are not sure what components to install, |
| 47 | see <a href="installing.html#components">Adding Platforms and Other |
| 48 | Components</a> for information. </p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 49 | |
| 50 | <p>If you develop applications using Eclipse, you may also need to update your |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 51 | ADT plugin when you update your development tools, in order to compile against |
| 52 | a new version of the platform. See the revisions listed in the <a |
| 53 | href="{@docRoot}sdk/tools-notes.html">SDK Tools</a> document for ADT |
| 54 | Plugin compatibility.</p> |
| 55 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 56 | <div style="TEXT-ALIGN:left; width:600px;"> |
| 57 | <img src="{@docRoot}images/sdk_manager_packages.png" |
| 58 | style="padding-bottom:0;margin-bottom:0;" /> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 59 | <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] | 60 | 1em;"><strong>Figure 1.</strong> The Android SDK and AVD Manager's |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 61 | <strong>Available Packages</strong> |
| 62 | panel, which shows the SDK components that are |
| 63 | available for you to download into your environment. </p> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 64 | </div> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 65 | |
| 66 | <h2 id="launching">Launching the Android SDK and AVD Manager</h2> |
| 67 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 68 | <p>The Android SDK and AVD Manager is the tool that you use to install and |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 69 | upgrade 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 |
| 74 | the 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, |
| 82 | follow these steps to access the Android SDK and AVD Manager tool:</p> |
| 83 | |
| 84 | <ol> |
| 85 | <li>Open Eclipse</li> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 86 | <li>Select <strong>Window</strong> > <strong>Android SDK and AVD |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 87 | Manager</strong>.</li> |
| 88 | </ol> |
| 89 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 90 | <h4>Launching from the SDK Manager script (Windows only)</h4> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 91 | |
| 92 | <p>For Windows only, the SDK includes a script that invokes the Android SDK and |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 93 | AVD Manager. To launch the tool using the script, double-click {@code SDK |
| 94 | Manager.exe} at the root of the the SDK directory.</p> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 95 | |
| 96 | <h4>Launching from a command line</h4> |
| 97 | |
| 98 | <p>In all development environments, follow these steps to access the Android SDK |
| 99 | and AVD Manager tool from the command line: </p> |
| 100 | |
| 101 | <ol> |
| 102 | <li>Navigate to the <code><<em>sdk</em>>/tools/</code> directory.</li> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 103 | <li>Execute the {@code android} tool command with no options. |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 104 | <pre style="width:400px">$ android</pre></li> |
| 105 | </ol> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 106 | |
| 107 | |
| 108 | <h2 id="InstallingComponents">Installing SDK Components</h2> |
| 109 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 110 | <p class="caution"><strong>Caution:</strong> Before you install SDK components, |
| 111 | we recommend that you disable any antivirus software that may be running on |
| 112 | your computer. There are cases in which antivirus software on Windows is known to interfere with the |
| 113 | installation process, so we suggest you disable your antivirus until installation is |
| 114 | complete.</p> |
Dirk Dougherty | a374f51 | 2009-11-09 11:41:09 -0800 | [diff] [blame] | 115 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 116 | <p>Follow these steps to install new SDK components in your environment:</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 117 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 118 | <ol> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 119 | <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 Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 121 | This will reveal all of the components that are currently available for download |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 122 | from the SDK repository.</li> |
| 123 | <li>Select the component(s) you'd like to install and click <strong>Install |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 124 | Selected</strong>. If you aren't sure which packages to select, read <a |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 125 | href="installing.html#which">Which components do I need?</a>.</li> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 126 | <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 Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 131 | <p>New platforms are automatically saved into the |
Dirk Dougherty | 0d1b081 | 2010-04-07 17:05:16 -0700 | [diff] [blame] | 132 | <code><<em>sdk</em>>/platforms/</code> directory of your SDK; |
| 133 | new add-ons are saved in the <code><<em>sdk</em>>/add-ons/</code> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 134 | directory; samples are saved in the |
| 135 | <code><<em>sdk</em>>/samples/android-<<em>level</em>>/</code>; |
Dirk Dougherty | 0d1b081 | 2010-04-07 17:05:16 -0700 | [diff] [blame] | 136 | and new documentation is saved in the existing |
| 137 | <code><<em>sdk</em>>/docs/</code> directory (old docs are replaced).</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 138 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 139 | |
| 140 | <h2 id="UpdatingComponents">Updating SDK Components</h2> |
| 141 | |
| 142 | <p>From time to time, new revisions of existing SDK components are released and |
| 143 | made available to you through the SDK repository. In most cases, if you have those |
| 144 | components installed in your environment, you will want |
| 145 | to 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 |
| 151 | site, in the "Downloadable SDK Components" section. </li> |
| 152 | <li>You can watch for updates listed in the <strong>Available Packages</strong> |
| 153 | panel 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 |
| 157 | and AVD Manager to quickly download it to your environment. Follow the same |
| 158 | procedure as given in <a href="">Installing SDK Components</a>, above. The new |
| 159 | component is installed in place of the old, but without impacting your |
| 160 | applications. </p> |
| 161 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 162 | <p class="note"><strong>Tip:</strong> |
| 163 | Use the "Display updates only" checkbox to show only the components |
| 164 | you do not have.</p> |
| 165 | |
| 166 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 167 | <h2 id="dependencies">SDK Component Dependencies</h2> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 168 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 169 | <p>In some cases, an SDK component may require a specific minimum revision of |
| 170 | another component or SDK tool. Where such dependencies exist, they are |
| 171 | documented in the revision notes for each component, available from the links in |
| 172 | the "Downloadable SDK Components" section at left.</p> |
| 173 | |
| 174 | <p>For example, there may be a dependency between the ADT Plugin for Eclipse and |
| 175 | the SDK Tools component. When you install the SDK Tools |
| 176 | component, you would then need to upgrade to the required version of ADT (if you |
| 177 | are 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 |
| 179 | Plugin Notes</a> and <a href="{@docRoot}sdk/tools-notes.html#notes">SDK Tools |
| 180 | Notes</a> documents. </p> |
| 181 | |
| 182 | <p>Additionally, the development tools will notify you with debug warnings |
| 183 | if 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 Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 189 | repository site, which offers platforms, SDK tools, documentation, the |
| 190 | Google APIs Add-on, and other components. You can add other sites that host |
Dirk Dougherty | eeb0b25 | 2009-10-22 16:08:32 -0700 | [diff] [blame] | 191 | their own Android SDK add-ons, then download the SDK add-ons |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 192 | from those sites.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 193 | |
Dirk Dougherty | eeb0b25 | 2009-10-22 16:08:32 -0700 | [diff] [blame] | 194 | <p>For example, a mobile carrier or device manufacturer might offer additional |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 195 | API libraries that are supported by their own Android-powered devices. In order |
| 196 | to 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 |
| 199 | on their web site, follow these steps to add their site to the SDK and AVD |
| 200 | Manager:</p> |
| 201 | |
| 202 | <ol> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 203 | <li>Select <strong>Available Packages</strong> in the left panel.</li> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 204 | <li>Click <strong>Add Site</strong> and enter the URL of the |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 205 | {@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 Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 208 | <strong>Available Packages</strong>.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 209 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 210 | <h2 id="troubleshooting">Troubleshooting</h2> |
Dirk Dougherty | 83d0925 | 2010-01-12 17:54:25 -0800 | [diff] [blame] | 211 | |
| 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 |
| 215 | connection problems, try connecting over http, rather than https. To switch the |
| 216 | protocol 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 & Apply</strong>.</li> |
| 224 | </ol> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 225 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 226 | |