page.title=Adding SDK Packages @jd:body
Adding and updating packages in your Android SDK is fast and easy. To add or update the individual SDK packages that you need, use the Android SDK Manager (included in the SDK Tools).
It only takes a couple of clicks to install individual versions of the Android platform, new development tools, new documentation, and SDK add-ons. The new SDK packages are automatically installed into your existing SDK directory, so you don't need to update your development environment to specify a new SDK location.
If you're setting up your Android SDK for the first time, see Installing the SDK for information about what packages to install.
Note: If you develop in Eclipse, you might also need to update your ADT plugin when you update your development tools. See the revisions listed in the ADT Plugin for Eclipse document.
Figure 1. The Android SDK Manager's Available Packages panel, which shows the SDK packages that are available for you to download into your environment.
The Android SDK Manager is the tool that you use to install and upgrade SDK packages in your development environment.
You can launch the Android SDK Manager in one of the following ways.
If you are developing in Eclipse and have already installed the ADT Plugin, follow these steps to access the Android SDK Manager tool:
For Windows only, the SDK includes a script that invokes the Android SDK Manager. To launch the tool using the script, double-click {@code SDK Manager.exe} at the root of the the SDK directory.
In all development environments, follow these steps to access the Android SDK Manager tool from the command line:
<sdk>/tools/
directory.$ android
Caution: Before you install SDK packages, we recommend that you disable any antivirus software that may be running on your computer. There are cases in which antivirus software on Windows is known to interfere with the installation process, so we suggest you disable your antivirus until installation is complete.
Follow these steps to install new SDK packages in your environment:
New platforms are automatically saved into the
<sdk>/platforms/
directory of your SDK;
new add-ons are saved in the <sdk>/add-ons/
directory; samples are saved in the
<sdk>/samples/android-<level>/
;
and new documentation is saved in the existing
<sdk>/docs/
directory (old docs are replaced).
From time to time, new revisions of existing SDK packages are released and made available to you through the SDK repository. In most cases, if you have those packages installed in your environment, you will want to download the new revisions as soon as possible.
You can learn about the release of new revisions in two ways:
When you see that a new revision is available, you can use the Android SDK Manager to quickly download it to your environment. Follow the same procedure as given in Installing SDK Packages, above. The new package is installed in place of the old, but without impacting your applications.
Tip: Use the "Display updates only" checkbox to show only the packages you do not have.
In some cases, an SDK package may require a specific minimum revision of another package or SDK tool. Where such dependencies exist, they are documented in the revision notes for each package, available from the links in the "Downloadable SDK packages" section at left.
For example, there may be a dependency between the ADT Plugin for Eclipse and the SDK Tools package. When you install the SDK Tools package, you should also upgrade to the required version of ADT (if you are developing in Eclipse). In this case, the major version number for your ADT plugin should always match the revision number of your SDK Tools (for example, ADT 8.x requires SDK Tools r8).
Also make sure that, each time you install a new version of the Android platform, you have the latest version of the SDK Platform-tools package. The SDK Platform-tools contain tools that are backward compatible with all versions of the Android platform and are often updated to support new features in the latest version of the Android platform.
The development tools will notify you with debug warnings if there is dependency that you need to address. The Android SDK Manager also enforces dependencies by requiring that you download any packages that are needed by those you have selected.
By default, Available Packages displays packages available from the Android Repository and Third party Add-ons. You can add other sites that host their own Android SDK add-ons, then download the SDK add-ons from those sites.
For example, a mobile carrier or device manufacturer might offer additional API libraries that are supported by their own Android-powered devices. In order to develop using their libraries, you must install their Android SDK add-on, if it's not already available under Third party Add-ons.
If a carrier or device manufacturer has hosted an SDK add-on repository file on their web site, follow these steps to add their site to the Android SDK Manager:
Any SDK packages available from the site will now be listed under a new item named User Add-ons.
Problems connecting to the SDK repository
If you are using the Android SDK Manager to download packages and are encountering connection problems, try connecting over http, rather than https. To switch the protocol used by the Android SDK Manager, follow these steps: