Download the Android SDK
Welcome Developers! If you are new to the Android SDK, please read the steps below, for an overview of how to set up the SDK.If you're already using the Android SDK, you should update to the latest tools or platform using the Android SDK and AVD Manager, rather than downloading a new SDK starter package. See Adding SDK Components.
Platform | Package | Size | MD5 Checksum |
---|---|---|---|
Windows | android-sdk_r18-windows.zip | 37448775 bytes | bfbfdf8b2d0fdecc2a621544d706fa98 |
installer_r18-windows.exe (Recommended) | 37456234 bytes | 48b1fe7b431afe6b9c8a992bf75dd898 | |
Mac OS X (intel) | android-sdk_r18-macosx.zip | 33903758 bytes | 8328e8a5531c9d6f6f1a0261cb97af36 |
Linux (i386) | android-sdk_r18-linux.tgz | 29731463 bytes | 6cd716d0e04624b865ffed3c25b3485c |
- Prepare your development computer and ensure it meets the system requirements.
- Install the SDK starter package from the table above. (If you're on Windows, download the installer for help with the initial setup.)
- Install the ADT Plugin for Eclipse (if you'll be developing in Eclipse).
- Add Android platforms and other packages to your SDK.
- Explore the contents of the Android SDK (optional).
Adding SDK Packages
Quickview
- Use the Android SDK Manager to set up your SDK and keep it up-to-date.
In this document
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.
Launching the Android SDK Manager
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.
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 Manager tool:- Open Eclipse
- Select Window > Android SDK Manager.
Launching from the SDK Manager script (Windows only)
For Windows only, the SDK includes a script that invokes the Android SDK Manager. To launch the tool using the script, double-clickSDK
Manager.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 Manager tool from the command line:- Navigate to the
<sdk>/tools/
directory. - Execute the
android
tool command with no options.$ android
Installing SDK Packages
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:- Launch the Android SDK Manager as described in the section above.
- Select Available Packages in the left panel. This will reveal all of the packages that are currently available for download from the SDK repository.
- Select the package(s) you'd like to install and click Install Selected. (If you aren't sure which packages to select, read Recommended Packages.)
- Verify and accept the packages you want (ensure each one is selected with a green checkmark) and click Install. The packages will now be installed into your existing Android SDK directories.
/platforms/
directory of your SDK;
new add-ons are saved in the /add-ons/
directory; samples are saved in the
/samples/android-/
;
and new documentation is saved in the existing
/docs/
directory (old docs are replaced).Updating SDK Packages
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:
- You can watch for updates listed in the "SDK" tab of the Android Developers site, in the "Downloadable SDK Packages" section.
- You can watch for updates listed in the Available Packages panel of the Android SDK Manager.
Tip:
Use the "Display updates only" checkbox to show only the packages
you do not have.
SDK Package Dependencies
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.
Adding New Sites
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:
- Select Available Packages in the left panel.
- Click Add Add-on Site and enter the URL of the
repository.xml
file. Click OK.
Troubleshooting
Problems connecting to the SDK repositoryIf 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:
- With the Android SDK 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.
Managing Virtual Devices
An Android Virtual Device (AVD) is an emulator configuration that lets you model an actual
device by defining hardware and software options to be emulated by the Android Emulator.
The easiest way to create an AVD is to use the graphical AVD Manager, which you launch from Eclipse by clicking Window > AVD Manager. You can also start the AVD Manager from the command line by calling the/tools/ directory.
You can also create AVDs on the command line by passing the
An AVD consists of:
Keep these points in mind when you are selecting a system image target for your AVD:
http://developer.android.com/guide/developing/devices/index.html
The AVD Manager is an easy to use user interface to manage your AVD (Android Virtual Device)
configurations. An AVD is a device configuration for the Android emulator that allows you to
model different configurations of Android-powered devices. When you start the AVD Manager in Eclipse
or run the
From the main screen, you can create, delete, repair and start AVDs as well as see the details of each AVD.
To create an AVD:
http://developer.android.com/guide/developing/devices/managing-avds.html
The easiest way to create an AVD is to use the graphical AVD Manager, which you launch from Eclipse by clicking Window > AVD Manager. You can also start the AVD Manager from the command line by calling the
android
tool with the avd
options, from the You can also create AVDs on the command line by passing the
android
tool options.
For more information on how to create AVDs in this manner, see Managing Virtual
Devices from the Command Line.An AVD consists of:
- A hardware profile: Defines the hardware features of the virtual device. For example, you can define whether the device has a camera, whether it uses a physical QWERTY keyboard or a dialing pad, how much memory it has, and so on.
- A mapping to a system image: You can define what version of the Android platform will run on the virtual device. You can choose a version of the standard Android platform or the system image packaged with an SDK add-on.
- Other options: You can specify the emulator skin you want to use with the AVD, which lets you control the screen dimensions, appearance, and so on. You can also specify the emulated SD card to use with the AVD.
- A dedicated storage area on your development machine: the device's user data (installed applications, settings, and so on) and emulated SD card are stored in this area.
Keep these points in mind when you are selecting a system image target for your AVD:
- The API Level of the target is important, because your application will not be able to run
on a system image whose API Level is less than that required by your application, as specified
in the
minSdkVersion
attribute of the application's manifest file. For more information about the relationship between system API Level and applicationminSdkVersion
, see Specifying Minimum System API Version. - You should create at least one AVD that uses a target whose API Level is greater than that required by your application, because it allows you to test the forward-compatibility of your application. Forward-compatibility testing ensures that, when users who have downloaded your application receive a system update, your application will continue to function normally.
- If your application declares a
uses-library
element in its manifest file, the application can only run on a system image in which that external library is present. If you want to run your application on an emulator, create an AVD that includes the required library. Usually, you must create such an AVD using an Add-on component for the AVD's platform (for example, the Google APIs Add-on contains the Google Maps library).
http://developer.android.com/guide/developing/devices/index.html
Managing AVDs with AVD Manager
In this document
android
tool on the command line, you will see the AVD Manager as shown in
figure 1:From the main screen, you can create, delete, repair and start AVDs as well as see the details of each AVD.
Creating an AVD
You can create as many AVDs as you would like to test on. It is recommended that you test your applications on all API levels higher than the target API level for your application.To create an AVD:
- Start the AVD Manager:
- In Eclipse: select Window > AVD Manager, or click the AVD Manager icon in the Eclipse toolbar.
- In other IDEs: Navigate to your SDK's
tools/
directory and execute theandroid
tool with no arguments.
- In the Virtual Devices panel, you'll see a list of existing AVDs. Click
New to create a new AVD. The Create New AVD dialog appears.
- Fill in the details for the AVD.
Give it a name, a platform target, an SD card size, and a skin (HVGA is default). You can
also add specific hardware features of the emulated device by clicking the
New... button and selecting the feature. For a list of hardware features,
see Hardware options.
Note: Be sure to define a target for your AVD that satisfies your application's Build Target (the AVD platform target must have an API Level equal to or greater than the API Level that your application compiles against). - Click Create AVD.
Hardware options
If you are creating a new AVD, you can specify the following hardware options for the AVD to emulate:Characteristic | Description | Property |
---|---|---|
Device ram size | The amount of physical RAM on the device, in megabytes. Default value is "96". | hw.ramSize |
Touch-screen support | Whether there is a touch screen or not on the device. Default value is "yes". | hw.touchScreen |
Trackball support | Whether there is a trackball on the device. Default value is "yes". | hw.trackBall |
Keyboard support | Whether the device has a QWERTY keyboard. Default value is "yes". | hw.keyboard |
DPad support | Whether the device has DPad keys. Default value is "yes". | hw.dPad |
GSM modem support | Whether there is a GSM modem in the device. Default value is "yes". | hw.gsmModem |
Camera support | Whether the device has a camera. Default value is "no". | hw.camera |
Maximum horizontal camera pixels | Default value is "640". | hw.camera.maxHorizontalPixels |
Maximum vertical camera pixels | Default value is "480". | hw.camera.maxVerticalPixels |
GPS support | Whether there is a GPS in the device. Default value is "yes". | hw.gps |
Battery support | Whether the device can run on a battery. Default value is "yes". | hw.battery |
Accelerometer | Whether there is an accelerometer in the device. Default value is "yes". | hw.accelerometer |
Audio recording support | Whether the device can record audio. Default value is "yes". | hw.audioInput |
Audio playback support | Whether the device can play audio. Default value is "yes". | hw.audioOutput |
SD Card support | Whether the device supports insertion/removal of virtual SD Cards. Default value is "yes". | hw.sdCard |
Cache partition support | Whether we use a /cache partition on the device. Default value is "yes". | disk.cachePartition |
Cache partition size | Default value is "66MB". | disk.cachePartition.size |
Abstracted LCD density | Sets the generalized density characteristic used by the AVD's screen. Default value is "160". | hw.lcd.density |
0 comments:
Post a Comment