Friday, April 19, 2013

Install Configure and integrate Android SDK with Eclipse

For Android development, you can use a Mac, a Windows PC, or a Linux machine. All the tools needed
are free and can be downloaded from the Web

Required Tools:
  1. Java  JDK (Java Development Kit)
  2. Eclipse
  3. Android SDK
  4. ADT (Android Development Tools)

Java Development Kit (JDK) 

If your computer does not have the JDK installed, you should start by downloading the JDK
from www.oracle.com/technetwork/java/javase/downloads/index.html and installing
it. Remember there is difference between JDK (Java Development Kit) used for development in JAVA and JRE (Java Run-time Error) used to support java application for browsers.

Eclipse

In the case of Android, the recommended IDE is Eclipse, a multi-language software development
environment featuring an extensible plug-in system. For Android development, you should download the Eclipse IDE for Java EE Developers from below link.

http://www.eclipse.org/downloads/

Android SDK

The next important piece of software you need to download is, of course, the Android SDK. The Android SDK contains a debugger, libraries, an emulator, documentation, sample code, and tutorials.
You can download the Android SDK from below link.

 http://developer.android.com/sdk/index.html

Android Development Tools (ADT )

The Android Development Tools (ADT) plug-in for Eclipse is an extension to the Eclipse IDE that
supports the creation and debugging of Android applicationsUsing the ADT, you will be able to do
the following in Eclipse

  1. Create new Android application projects.
  2. Access the tools for accessing your Android emulators and devices.
  3. Export Android applications into Android Packages (APK).
  4. Create digital certificates for code-signing your APK.
 To install the ADT, first launch Eclipse by double-clicking on the eclipse.exe file located in the
eclipse folder. When Eclipse is first started, you will be prompted for a folder to use as your workspace. In Eclipse, a workspace is a folder where you store all your projects. Take the default suggested and click OK.
Once Eclipse is up and running, select the Help ➪ Install New Software… menu item (see
Figure).
In the Install window that appears, type http://dl-ssl.google.com/android/eclipse in the text box (see
Figure) and click Add….


 When you see the installation details, as shown in Figure click Next.

You will be asked to review the licenses for the tools. Check the option to accept the license agreements
(see Figure). Click Finish to continue.

 Eclipse will now proceed to download the tools from the Internet and install them (see Figure).
This will take some time, so be patient. 
Once the ADT is installed, you will be prompted to restart Eclipse. After doing so, go to Window ➪ Preferences (see Figure).

In the Preferences window that appears, select Android. You will see an error message saying that the SDK has not been set up (see Figure). Click OK to dismiss it.

Enter the location of the Android SDK folder. In this example, it would be C:\Android\android-sdk-windows. Click OK.

Creating Android Virtual Devices (AVDs)

The next step is to create AVD to be used for testing your Android applications. AVD stands for Android Virtual Devices. An AVD is an emulator instance that enables you to model an actual device. Each AVD consists of a hardware profile, a mapping to a system image, as well as emulated storage, such as a secure digital (SD) card.You can create as many AVDs as you want in order to test your applications with several different configurations.This testing is important to confi rm the behavior of your application when it is run on different devices with varying capabilities. To create an AVD, go to Windows ➪ Android SDK and AVD Manager. Select the Available packages option in the left pane and expand the package name shown in the right pane.

Check the relevant tools, documentation, and platforms you need for your project. Once you have selected the items you want, click the Install Selected button to download them. Because it takes a while to download from Google’s server, it is a good idea to download only whatever you need immediately, and download the rest when you have more time. Each version of the Android OS is identified by an API level number. For example, Android 2.3 is level 9 (API 9), while Android 2.2 is level 8 (API 8).
Click the Virtual Devices item in the left pane of the window. Then click the New… button located
in the right pane of the window. In the Create new Android Virtual Device (AVD) window, enter the items as shown in Figure.
Click the Create AVD button when you are done.
With all the tools and the SDK downloaded and installed, it is now time to start your engine and create your first app.