In this part of the chapter, we will see how to install the development environment for Android on the Eclipse Juno (4.2). Eclipse is the major IDE for Android development (see the following screenshot). We need to install eclipse extension ADT (Android Development Toolkit) for development of the Android Application:
To download Android packages a Google API internet connection is a must, hence take this in notice before moving further. The steps on Windows using Eclipse Juno are as follows:
Software needed:
To check whether your PC has an existing JDK and it is installed correctly, go to command prompt, and type javac –version
(as shown in the following screenshot). It is recommended to install JDK 1.6.x for Android Application Development as it may complain that the compiler compliance level is greater than 6, and could run into problems:
You may download JDK 1.6 (Java Development Toolkit) from the download site and install it. Make sure that JAVA_HOME is set after the installation, and check the version executing the preceding command.http://www.oracle.com/technetwork/java/javase/downloads/index.html (see the following screenshot).
This step can be skipped if we have java 1.6.x installed:
Create a folder named android-dev
(android-dev is just a suggestion; you may create another name instead). The folder android-dev
will be used consistently throughout this chapter. This folder is to hold all the software that is needed for Android development. This folder is needed again in another procedure.
Download from http://developer.android.com/sdk/index.html, and install this software in the android-dev
folder. Bear in mind this download only provides the basic tools of Android SDK, not the complete installation. Later, we need to download the Android system images, APIs, examples, documentations and other libraries:
After completion of the download, install the SDK in the folder mentioned earlier; in C:\android-dev\android-sdk
as shown in following screenshot.
During the installation, the Android SDK will detect the Java Development Kit in the machine. If we have installed the latest JDK, it should have no problems:
Eclipse Juno (4.2) is available for download at http://www.eclipse.org/downloads/:
The Eclipse comes in a ZIP file, so just unzip it and find the eclipse.exe
file to run it.
Immediately extract Eclipse in the folder as created earlier (in C:\android-dev
). After the extraction, create a desktop shortcut to make life easier, as depicted in the following screenshot:
Run Eclipse by identifying the Eclipse installation folder and double-click eclipse.exe
(or double-click the shortcut in the Desktop). Provide a folder to store all the projects' source codes. And once again, create this folder under the android-dev
folder, as shown in the following screenshot:
This new Eclipse installation does not provide the Android Developer Toolkits (ADT) plugins. To install this plugin navigate to Window | Preferences to open the Preferences panel. Click on Install/Update | Available Software Sites (on the left panel). Click on the Add button (on the right panel) to add a software download site (again an Internet connection is needed).
Another window will appear. Provide ADT
in the Name (for example), and the Location https://dl-ssl.google.com/android/eclipse/
(as provided in http://developer.android.com/sdk/eclipse-adt.html):
In the Available Software dialog, select the checkbox next to Developer Tools and click on Next. In the next window, you'll see a list of the tools to be downloaded. Select all except NDK plugins and click on Next. We will be discussing the tools in the next chapters:
Read and accept the license agreements, then click on Finish. If you get a security warning saying that the authenticity or validity of the software can't be established, click on OK. When the installation completes, restart Eclipse.