Saturday 27 July 2013

SDK Manager

The Android SDK separates tools, platforms, and other components into packages you can download using the SDK Manager.
You can launch the SDK Manager in one of the following ways:
  • From Eclipse (with ADT), select Window > Android SDK Manager.
  • On Windows, double-click the SDK Manager.exe file at the root of the Android SDK directory.
  • On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK, then execute android sdk.
You can select which packages you want to download by toggling the checkboxes on the left, then click Install to install the selected packages.
Figure 1. The Android SDK Manager shows the SDK packages that are available, already installed, or for which an update is available.

Here's an outline of the packages required and those we recommend you use:
SDK Tools
Required. Your new SDK installation already has the latest version. Make sure you keep this up to date.
SDK Platform-tools
Required. You must install this package when you install the SDK for the first time.
SDK Platform
Required.You must download at least one platform into your environment so you're able to compile your application. In order to provide the best user experience on the latest devices, we recommend that you use the latest platform version as your build target. You'll still be able to run your app on older versions, but you must build against the latest version in order to use new features when running on devices with the latest version of Android. To get started, download the latest Android version, plus the lowest version you plan to support (we recommend Android 2.2 for your lowest version).
System Image
Recommended. Although you might have one or more Android-powered devices on which to test your app, it's unlikely you have a device for every version of Android your app supports. It's a good practice to download system images for all versions of Android your app supports and test your app running on them with the Android emulator.
Android Support
Recommended. Includes a static library that allows you to use some of the latest Android APIs (such as fragments, plus others not included in the framework at all) on devices running a platform version as old as Android 1.6. All of the activity templates available when creating a new project with the ADT Plugin require this. For more information, read Support Library.
SDK Samples
Recommended. The samples give you source code that you can use to learn about Android, load as a project and run, or reuse in your own app. Note that multiple samples packages are available — one for each Android platform version. When you are choosing a samples package to download, select the one whose API Level matches the API Level of the Android platform that you plan to use.
Tip: For easy access to the SDK tools from a command line, add the location of the SDK's tools/ and platform-tools to your PATH environment variable.

Setting Up the ADT Bundle

The ADT Bundle provides everything you need to start developing apps, including a version of the Eclipse IDE with built-in ADT (Android Developer Tools) to streamline your Android app development. If you haven't already, go download the Android ADT Bundle. (If you downloaded the SDK Tools only, for use with an existing IDE, you should instead read Setting Up an Existing IDE.)

Install the SDK and Eclipse IDE

  1. Unpack the ZIP file (named adt-bundle-<os_platform>.zip) and save it to an appropriate location, such as a "Development" directory in your home directory.
  2. Open the adt-bundle-<os_platform>/eclipse/ directory and launch eclipse.
That's it! The IDE is already loaded with the Android Developer Tools plugin and the SDK is ready to go. To start developing, read Building Your First App.
Caution: Do not move any of the files or directories from the adt-bundle-<os_platform> directory. If you move the eclipse or sdk directory, ADT will not be able to locate the SDK and you'll need to manually update the ADT preferences.

Additional information

As you continue developing apps, you may need to install additional versions of Android for the emulator and other packages such as the library for Google Play In-app Billing. To install more packages, use the SDK Manager.
Everything you need to develop Android apps is on this web site, including design guidelines, developer training, API reference, and information about how you can distribute your app. For additional resources about developing and distributing your app, see the Developer Support Resources.

Building Your First App

Dependencies and prerequisites

Welcome to Android application development!
This class teaches you how to build your first Android app. You’ll learn how to create an Android project and run a debuggable version of the app. You'll also learn some fundamentals of Android app design, including how to build a simple user interface and handle user input.
Before you start this class, be sure you have your development environment set up. You need to:
  1. Download the Android SDK.
  2. Install the ADT plugin for Eclipse (if you’ll use the Eclipse IDE).
  3. Download the latest SDK tools and platforms using the SDK Manager.
If you haven't already done these tasks, start by downloading the Android SDK and following the install steps. Once you've finished the setup, you're ready to begin this class.
This class uses a tutorial format that incrementally builds a small Android app that teaches you some fundamental concepts about Android development, so it's important that you follow each step.