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 | |
Scott Main | 38dea27 | 2010-11-01 13:03:25 -0700 | [diff] [blame] | 25 | <p>Adding and updating components in your Android SDK is fast and easy. To add or |
| 26 | update the individual SDK components that you need, use the <em>Android SDK and AVD |
| 27 | Manager</em> (included in the SDK Tools).</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 28 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 29 | <p>It only takes a couple of clicks to install individual versions of the |
| 30 | Android platform, new development tools, new documentation, and SDK add-ons. The |
| 31 | new SDK components are automatically installed into your existing SDK directory, |
| 32 | so you don't need to update your development environment to specify a new SDK |
| 33 | location.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 34 | |
Scott Main | 38dea27 | 2010-11-01 13:03:25 -0700 | [diff] [blame] | 35 | <p>If you're setting up your Android SDK for the first time, |
| 36 | see <a href="{@docRoot}sdk/installing.html#components">Installing the SDK</a> for information about |
| 37 | what components to install.</p> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 38 | |
Scott Main | 38dea27 | 2010-11-01 13:03:25 -0700 | [diff] [blame] | 39 | <p class="note"><strong>Note:</strong> If you develop in Eclipse, you might also need |
| 40 | to 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 Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 42 | |
Scott Main | 38dea27 | 2010-11-01 13:03:25 -0700 | [diff] [blame] | 43 | <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 Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 46 | available for you to download into your environment. </p> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 47 | </div> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 48 | |
| 49 | <h2 id="launching">Launching the Android SDK and AVD Manager</h2> |
| 50 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 51 | <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] | 52 | upgrade SDK components in your development environment. </p> |
| 53 | |
Scott Main | 38dea27 | 2010-11-01 13:03:25 -0700 | [diff] [blame] | 54 | <p>You can launch the Android SDK and AVD Manager in one of the following ways.</p> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 55 | |
| 56 | <h4>Launching from Eclipse/ADT</h4> |
| 57 | |
| 58 | <p>If you are developing in Eclipse and have already installed the ADT Plugin, |
| 59 | follow these steps to access the Android SDK and AVD Manager tool:</p> |
| 60 | |
| 61 | <ol> |
| 62 | <li>Open Eclipse</li> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 63 | <li>Select <strong>Window</strong> > <strong>Android SDK and AVD |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 64 | Manager</strong>.</li> |
| 65 | </ol> |
| 66 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 67 | <h4>Launching from the SDK Manager script (Windows only)</h4> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 68 | |
| 69 | <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] | 70 | AVD Manager. To launch the tool using the script, double-click {@code SDK |
| 71 | Manager.exe} at the root of the the SDK directory.</p> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 72 | |
| 73 | <h4>Launching from a command line</h4> |
| 74 | |
| 75 | <p>In all development environments, follow these steps to access the Android SDK |
| 76 | and AVD Manager tool from the command line: </p> |
| 77 | |
| 78 | <ol> |
| 79 | <li>Navigate to the <code><<em>sdk</em>>/tools/</code> directory.</li> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 80 | <li>Execute the {@code android} tool command with no options. |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 81 | <pre style="width:400px">$ android</pre></li> |
| 82 | </ol> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 83 | |
| 84 | |
| 85 | <h2 id="InstallingComponents">Installing SDK Components</h2> |
| 86 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 87 | <p class="caution"><strong>Caution:</strong> Before you install SDK components, |
| 88 | we recommend that you disable any antivirus software that may be running on |
| 89 | your computer. There are cases in which antivirus software on Windows is known to interfere with the |
| 90 | installation process, so we suggest you disable your antivirus until installation is |
| 91 | complete.</p> |
Dirk Dougherty | a374f51 | 2009-11-09 11:41:09 -0800 | [diff] [blame] | 92 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 93 | <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] | 94 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 95 | <ol> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 96 | <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 Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 98 | 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] | 99 | from the SDK repository.</li> |
| 100 | <li>Select the component(s) you'd like to install and click <strong>Install |
Scott Main | 4fb51ca | 2010-11-09 14:47:15 -0800 | [diff] [blame] | 101 | Selected</strong>. (If you aren't sure which packages to select, read <a |
| 102 | href="installing.html#which">Recommended Components</a>.)</li> |
| 103 | <li>Verify and accept the components you want (ensure each one is selected with a green |
| 104 | checkmark) and click <strong>Install</strong>. The components will now be installed into |
| 105 | your existing Android SDK directories.</li> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 106 | </ol> |
| 107 | |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 108 | <p>New platforms are automatically saved into the |
Scott Main | 4fb51ca | 2010-11-09 14:47:15 -0800 | [diff] [blame] | 109 | <code><sdk>/platforms/</code> directory of your SDK; |
| 110 | new add-ons are saved in the <code><sdk>/add-ons/</code> |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 111 | directory; samples are saved in the |
Scott Main | 4fb51ca | 2010-11-09 14:47:15 -0800 | [diff] [blame] | 112 | <code><sdk>/samples/android-<level>/</code>; |
Dirk Dougherty | 0d1b081 | 2010-04-07 17:05:16 -0700 | [diff] [blame] | 113 | and new documentation is saved in the existing |
Scott Main | 4fb51ca | 2010-11-09 14:47:15 -0800 | [diff] [blame] | 114 | <code><sdk>/docs/</code> directory (old docs are replaced).</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 115 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 116 | |
| 117 | <h2 id="UpdatingComponents">Updating SDK Components</h2> |
| 118 | |
| 119 | <p>From time to time, new revisions of existing SDK components are released and |
| 120 | made available to you through the SDK repository. In most cases, if you have those |
| 121 | components installed in your environment, you will want |
| 122 | to 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 |
| 128 | site, in the "Downloadable SDK Components" section. </li> |
| 129 | <li>You can watch for updates listed in the <strong>Available Packages</strong> |
| 130 | panel 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 |
| 134 | and AVD Manager to quickly download it to your environment. Follow the same |
Scott Main | 93d204e | 2010-12-06 15:19:37 -0800 | [diff] [blame] | 135 | procedure as given in <a href="#InstallingComponents">Installing SDK Components</a>, above. The new |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 136 | component is installed in place of the old, but without impacting your |
| 137 | applications. </p> |
| 138 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 139 | <p class="note"><strong>Tip:</strong> |
| 140 | Use the "Display updates only" checkbox to show only the components |
| 141 | you do not have.</p> |
| 142 | |
| 143 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 144 | <h2 id="dependencies">SDK Component Dependencies</h2> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 145 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 146 | <p>In some cases, an SDK component may require a specific minimum revision of |
| 147 | another component or SDK tool. Where such dependencies exist, they are |
| 148 | documented in the revision notes for each component, available from the links in |
| 149 | the "Downloadable SDK Components" section at left.</p> |
| 150 | |
| 151 | <p>For example, there may be a dependency between the ADT Plugin for Eclipse and |
| 152 | the SDK Tools component. When you install the SDK Tools |
Scott Main | dfb1221 | 2010-11-10 11:59:33 -0800 | [diff] [blame] | 153 | component, you should also upgrade to the required version of ADT (if you |
| 154 | are developing in Eclipse). In this case, the major version number for your ADT plugin should |
| 155 | always match the revision number of your SDK Tools (for example, ADT 8.x requires SDK Tools r8). |
| 156 | </p> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 157 | |
Scott Main | dfb1221 | 2010-11-10 11:59:33 -0800 | [diff] [blame] | 158 | <p>Also make sure that, each time you install a new version of the Android platform, you have |
| 159 | the latest version of the SDK Platform-tools component. The SDK Platform-tools contain |
| 160 | tools that are backward compatible with all versions of the Android platform and are |
| 161 | often updated to support new features in the latest version of the Android platform.</p> |
| 162 | |
| 163 | <p>The development tools will notify you with debug warnings if there is dependency that you need to |
| 164 | address. The SDK and AVD Manager also enforces dependencies by requiring that you download any |
| 165 | components that are needed by those you have selected.</p> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 166 | |
| 167 | |
| 168 | <h2 id="AddingSites">Adding New Sites</h2> |
| 169 | |
Scott Main | 4fb51ca | 2010-11-09 14:47:15 -0800 | [diff] [blame] | 170 | <p>By default, <strong>Available Packages</strong> displays components available from the |
| 171 | <em>Android Repository</em> and <em>Third party Add-ons</em>. You can add other sites that host |
Dirk Dougherty | eeb0b25 | 2009-10-22 16:08:32 -0700 | [diff] [blame] | 172 | their own Android SDK add-ons, then download the SDK add-ons |
Scott Main | 06cf15e | 2010-10-28 00:02:31 -0700 | [diff] [blame] | 173 | from those sites.</p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 174 | |
Dirk Dougherty | eeb0b25 | 2009-10-22 16:08:32 -0700 | [diff] [blame] | 175 | <p>For example, a mobile carrier or device manufacturer might offer additional |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 176 | API libraries that are supported by their own Android-powered devices. In order |
Scott Main | 4fb51ca | 2010-11-09 14:47:15 -0800 | [diff] [blame] | 177 | to develop using their libraries, you must install their Android SDK add-on, if it's not already |
| 178 | available under <em>Third party Add-ons</em>. </p> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 179 | |
| 180 | <p>If a carrier or device manufacturer has hosted an SDK add-on repository file |
| 181 | on their web site, follow these steps to add their site to the SDK and AVD |
| 182 | Manager:</p> |
| 183 | |
| 184 | <ol> |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 185 | <li>Select <strong>Available Packages</strong> in the left panel.</li> |
Scott Main | 4fb51ca | 2010-11-09 14:47:15 -0800 | [diff] [blame] | 186 | <li>Click <strong>Add Add-on Site</strong> and enter the URL of the |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 187 | {@code repository.xml} file. Click <strong>OK</strong>.</li> |
| 188 | </ol> |
Scott Main | 4fb51ca | 2010-11-09 14:47:15 -0800 | [diff] [blame] | 189 | <p>Any SDK components available from the site will now be listed under a new item named |
| 190 | <strong>User Add-ons</strong>.</p> |
| 191 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 192 | |
Dirk Dougherty | 7b229ef | 2010-03-26 17:32:26 -0700 | [diff] [blame] | 193 | <h2 id="troubleshooting">Troubleshooting</h2> |
Dirk Dougherty | 83d0925 | 2010-01-12 17:54:25 -0800 | [diff] [blame] | 194 | |
| 195 | <p><strong>Problems connecting to the SDK repository</strong></p> |
| 196 | |
| 197 | <p>If you are using the SDK and AVD Manager to download components and are encountering |
| 198 | connection problems, try connecting over http, rather than https. To switch the |
| 199 | protocol used by the SDK and AVD Manager, follow these steps: </p> |
| 200 | |
| 201 | <ol> |
| 202 | <li>With the Android SDK and AVD Manager window open, select "Settings" in the |
| 203 | left pane. </li> |
| 204 | <li>On the right, in the "Misc" section, check the checkbox labeled "Force |
| 205 | https://... sources to be fetched using http://..." </li> |
| 206 | <li>Click <strong>Save & Apply</strong>.</li> |
| 207 | </ol> |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 208 | |
Dirk Dougherty | ee58d1b | 2009-10-16 15:25:15 -0700 | [diff] [blame] | 209 | |