Adding SDK Components
Adding and updating components in
your Android SDK is fast and easy. To perform an update, use the Android SDK
and AVD Manager to install or update the individual SDK components that you
need. The Android SDK and AVD Manager tool is included in the Android
SDK download.
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 components are automatically
installed into your existing SDK directory, so you don't need to update your
development environment to specify a new SDK location.
Because each version of the Android
platform can be installed as an individual component of your SDK, you can
customize your development environment to the Android platforms you are
targetting. Testing your app on multiple versions of the platform is very
important in order to successfully operate on as many devices as possible. Be
sure to install each version of the Android platform with which your app is
compatible, then test your apps on AVDs that run
each platform.
If you are just getting started and
you are not sure what components to install, see Adding Platforms and Other Components for information.
If you develop applications using
Eclipse, you may also need to update your ADT plugin when you update your
development tools, in order to compile against a new version of the platform.
See the revisions listed in the SDK Tools
document for ADT Plugin compatibility.
Launching
the Android SDK and AVD Manager
The Android SDK and AVD Manager is
the tool that you use to install and upgrade SDK components in your development
environment.
You can access the tool in any of
three ways:
- If you are developing in the Eclipse IDE with the ADT Plugin, you can access the tool directly from the Eclipse UI.
- On Windows only, you can launch he tool by double-clicking a script file.
- In all environments, you can access the tool from a command line.
Launching
from Eclipse/ADT
If you are developing in Eclipse and
have already installed the ADT Plugin, follow these steps to access the Android
SDK and AVD Manager tool:
- Open Eclipse
- Select Window > Android SDK and AVD Manager.
Launching
from the setup script (Windows only)
For Windows only, the SDK includes a
script that invokes the Android SDK and AVD Manager. To launch the tool using
the script, double-click "SDK Setup.exe" at the root of the the SDK
directory.
Launching
from a command line
In all development environments,
follow these steps to access the Android SDK and AVD Manager tool from the
command line:
- Navigate to the <sdk>/tools/ directory.
- Execute the android tool command with no options.
$
android
Installing
SDK Components
Important: Before you install SDK components, we recommend that you
disable any antivirus programs that may be running on your computer.
Follow these steps to install new
SDK components in your environment:
- Launch the Android SDK and AVD Manager as described in the section above.
- Select Available Packages in the left panel. This will reveal all of the components that are currently available for download from the SDK repository.
- Select the component(s) you'd like to install and click Install Selected. If you aren't sure which packages to select, read Which components do I need?.
- Verify and accept the components you want and click Install Accepted. The components will now be installed into your existing Android SDK directories.
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).
Updating
SDK Components
From time to time, new revisions of
existing SDK components are released and made available to you through the SDK
repository. In most cases, if you have those components 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:
- You can watch for updates listed in the "SDK" tab of the Android Developers site, in the "Downloadable SDK Components" section.
- You can watch for updates listed in the Available Packages panel of the Android SDK and AVD Manager.
When you see that a new revision is
available, you can use the Android SDK and AVD Manager to quickly download it
to your environment. Follow the same procedure as given in Installing SDK Components,
above. The new component is installed in place of the old, but without
impacting your applications.
Tip: Use the "Display updates only" checkbox to show
only the components you do not have.
SDK
Component Dependencies
In some cases, an SDK component may
require a specific minimum revision of another component or SDK tool. Where
such dependencies exist, they are documented in the revision notes for each
component, available from the links in the "Downloadable SDK
Components" section at left.
For example, there may be a
dependency between the ADT Plugin for Eclipse and the SDK Tools component. When
you install the SDK Tools component, you would then need to upgrade to the
required version of ADT (if you are developing in Eclipse). In this case, you
would find dependencies listed in "Revisions" section of the ADT Plugin Notes
and SDK Tools Notes
documents.
Additionally, the development tools
will notify you with debug warnings if there is dependency that you need to
address.
Adding
New Sites
By default, Available Packages
only shows the default repository site, which offers platforms, SDK tools,
documentation, the Google APIs Add-on, and other components. 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 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 SDK and AVD Manager:
- Select Available Packages in the left panel.
- Click Add Site and enter the URL of the repository.xml file. Click OK.
Any SDK components available from
the site will now be listed under Available Packages.
Troubleshooting
Problems connecting to the SDK
repository
If you are using the SDK and AVD
Manager to download components and are encountering connection problems, try
connecting over http, rather than https. To switch the protocol used by the SDK
and AVD Manager, follow these steps:
- With the Android SDK and AVD Manager window open, select "Settings" in the left pane.
- On the right, in the "Misc" section, check the checkbox labeled "Force https://... sources to be fetched using http://..."
- Click Save & Apply.
Windows XP: Perform a fresh installation
To install the Android USB driver on Windows XP for the first time:- Connect your Android-powered device to your computer's USB port. Windows will detect the device and launch the Hardware Update Wizard.
- Select "Install from a list or specific location" and click "Next."
- Select "Search for the best driver in these locations"; un-check "Search removable media"; and check "Include this location in the search."
- Click "Browse..." and locate the folder where you copied the installation package.
- Click "Next" to install the driver.
Windows XP: Upgrade an existing driver
To upgrade an existing Android USB driver on Windows XP with the new driver:- Connect your Android-powered device to your computer's USB port.
- Right-click on "My Computer" from your desktop or Windows Explorer, and select "Manage."
- Select "Device Manager" in the left pane of the Computer Management window.
- Locate and expand "Android Phone" in the right pane.
- Right-click "Android Composite ADB Interface" and select "Update Driver..." This will launch the Hardware Update Wizard.
- Select "Install from a list or specific location" and click "Next."
- Select "Search for the best driver in these locations"; un-check "Search removable media"; and check "Include this location in the search."
- Click "Browse..." and locate the folder where you copied the installation package.
- Click "Next" to install the driver.
Quick Start
The steps below provide an overview of how to get started with the Android SDK. For detailed instructions, start with the Installing the SDK guide.1. Prepare your development computer
Read the System Requirements document and make sure that your development computer meets the hardware and software requirements for the Android SDK. Install any additional software needed before downloading the Android SDK. In particular, you may need to install the JDK (version 5 or 6 required) and Eclipse (version 3.4 or 3.5, needed only if you want develop using the ADT Plugin).
2. Download and install the SDK starter package
Select a starter package from the table at the top of this page and download it to your development computer. To install the SDK, simply unpack the starter package to a safe location and then add the location to your PATH.
3. Install the ADT Plugin for Eclipse
If you are developing in Eclipse, set up a remote update site at
https://dl-ssl.google.com/android/eclipse/
.
Install the Android Development Tools (ADT) Plugin, restart Eclipse, and set
the "Android" preferences in Eclipse to point to the SDK install
location. For detailed instructions, see ADT Plugin for Eclipse.4. Add Android platforms and other components to your SDK
Use the Android SDK and AVD Manager, included in the SDK starter package, to add one or more Android platforms (for example, Android 1.6 or Android 2.2) and other components to your SDK. If you aren't sure what to add, see Which components do I need?
To launch the Android SDK and AVD Manager on Windows, execute
SDK Setup.exe
, at the root of the SDK
directory. On Mac OS X or Linux, execute the android
tool in the <sdk>/tools/
folder. For detailed instructions, see Adding SDK
Components.Done!
If you are new to Android, you can use the Hello World tutorial to get started quickly. Next Steps offers other suggestions of how to begin.
For a more detailed guide to installing and setting up the SDK, read Installing the SDK.
No comments:
Post a Comment