This blog will help the Android Application Development learners to understand comprehensively the steps necessary to set up the initial development environment for creating Android applications.
It will address the installation of the Android Software Development Kit (SDK) and the initial set-up necessary for allowing Android OS emulation.
Download an IDE: Writing Android code is being done using an editor, the best supported is Eclipse. Eclipse is an open-source freeware editor that is capable of supporting a wide range of programming languages. The latest version of the software can be downloaded here: http://www.eclipse.org/downloads/packages/release/indigo/r
You can choose the version that match up to your Operating System (Linux, Windows or Mac)
Install Eclipse: Make sure to take note of the installation directory and workspace for later reference
Download and install the Java Runtime Environment (JRE): The file can be downloaded here: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Download and install the Java Development Kit (JDK): The file can be downloaded here: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Downloading the Android Developer Tools (ADT) Bundle: Majorly, the work involved in android application development will be performed using the Eclipse Integrated Development Environment (IDE). If you are already using Eclipse to develop for other platforms, then the Android Developer Tools (ADT) plug-in can be integrated into your existing Eclipse installation. If, on the other hand, you are entirely new to Eclipse based development, the most convenient path to take is to install a package known as the AD T Bundle. This bundle includes many of the tools necessary to begin developing Android applications in a single download. The ADT Bundle may be downloaded from the following web page:
From this page, either click on the download button if it lists the correct platform (for example on a Windows based web browser the button will read “Download the SDK ADT Bundle for Windows”), or select the “Download for Other Platforms” option to manually select the appropriate package for your platform and operating system.
On the subsequent screen, accept the terms and conditions, the target architecture of your computer system (32-bit or 64-bit) and click on the download button. Note that your choice of 32-bit or 64-bit should match the architecture chosen for the JDK installation. Attempting to run a 64-bit ADT bundle using a 32-bit JDK, for example, will result in errors when attempting to launch Eclipse.
Installing the ADT Bundle: The ADT Bundle is downloaded as a compressed ZIP archive file which must be unpacked to complete the installation process. The exact steps to achieve this differ depending on the operating system.
Installation on Windows
Locate the downloaded ADT Bundle zip file in a Windows Explorer window, right-click on it and select the Extract All… menu option. In the resulting dialog, choose a suitable location into which to unzip the file before clicking on the Extract button. When choosing a suitable location, keep in mind that the extraction will create a sub-folder in the chosen location named either adt-bundle-windows-x86 or adt-bundle-windows-x86_64 containing the bundle packages.
Once the extraction is complete, navigate in Windows Explorer to the directory containing the ADT bundle, move into the eclipse sub-folder and double click on the eclipse executable to start the Eclipse IDE environment. For easier future access, right click on the eclipse executable and select Pin to Taskbar from the resulting menu.
It is possible that Windows will display a Security Warning dialog before Eclipse will launch stating that the publisher could not be verified. In the event that this warning appears, uncheck the “Always ask before opening this file” option before clicking the Run button. Once invoked, Eclipse will prompt for the location of the workspace. All projects will be stored by default into this folder. Browse for a suitable location, or choose the default offered by Eclipse and click on OK.
Installation on Mac OS X
When using Safari to download the ADT bundle archive, it is possible that Safari will automatically unzip the file once the download is complete (this is typically the default setting for Safari these days). This being the case, the location into which the download was saved will contain a directory named as follows:
Using the Finder, simply move this folder to a permanent location on your file system.
In the event that the browser did not automatically unzip the bundle archive, open a terminal window, change directory to the location where Eclipse is to be installed and execute the following command:
unzip /<path to package>/<package name>.zip
For example, assuming a package file named adt-bundle-mac-x86_64-20131030.zip has been downloaded to /home/demo/Downloads, the following command would be needed to install Eclipse:
Note that, in the above example, the bundle will be installed into a sub-directory named adt-bundle-mac-x86_64-20131030. Assuming, therefore, that the above command was executed in /Users/demo, the software packages will be unpacked into /Users/demo/adt-bundle-mac-x86_64-20131030. Within this directory, the files comprising the Eclipse IDE are installed in a sub-directory named eclipse.
Using the Finder tool, navigate to the eclipse sub-directory of the ADT bundle installation directory and double click on the eclipse executable to launch the application. For future easier access to the tool, simply drag the eclipse icon from the Finder window and drop it onto the dock.
Installation on Linux
On Linux systems, open a terminal window, change directory to the location where Eclipse is to be installed and execute the following command:
unzip /<path to package>/<package name>.zip
For example, assuming a package file named adt-bundle-linux-x86-20131030.zip has been downloaded to /home/demo/Downloads, the following command would be needed to install Eclipse:
Note that the bundle will be installed into a sub-directory named either adt-bundle-linux-x86-20131030 or adt-bundle-linux-x86_64-20131030 depending on whether the 32-bit or 64-bit edition was downloaded. Assuming, therefore, that the above command was executed in /home/demo, the software packages will be unpacked into /home/demo/adt-bundle-linux-x86-20131030. Within this directory, the files comprising the Eclipse IDE are installed in a sub-directory named eclipse.
To launch Eclipse, open a terminal window, change directory to the eclipse sub-directory of the ADT bundle installation directory and execute the following command:
Once invoked, Eclipse will prompt for the location of the workspace. All projects will be stored by default into this folder. Browse for a suitable location, or choose the default offered by Eclipse and click on OK.
Having verified that the Eclipse IDE is installed correctly, keep Eclipse running so that it can be used to install additional Android SDK packages.
Installing the Latest Android SDK Packages
The steps performed so far have installed Java, the Eclipse IDE and the current set of default Android SDK packages. Before proceeding, it is worth taking some time to verify which packages are installed and to install any missing packages.
This task can be performed using the Android SDK Manager, which may be launched from within the Eclipse tool by selecting the Window -> Android SDK Manager Menu option. Once invoked, the SDK Manager tool will appear
Once the SDK Manager is running, return to the main Eclipse window and select the File -> Exit menu option to exit from the Eclipse environment. This will leave the Android SDK Manager running whilst ensuring that the Eclipse session does not conflict with the installation process.
Begin by checking that the SDK Path: setting at the top of the SDK Manager window matches the location into which the ADT Bundle package was unzipped. If it does not, re-launch Eclipse and select the Window -> Preferences option. In the Preferences dialog, select the Android option from the left hand panel and change the SDK Location setting so that it references the sdk sub-folder of the directory into which the ADT Bundle was unzipped before clicking on Apply followed by OK.
Within the Android SDK Manager, make sure that the check boxes next to the following packages are listed as Installed in the Status column:
- Tools > Android SDK Tools
- Tools > Android SDK Platform-tools
- SDK Platform Android 4.4 API 19 > SDK Platform
- SDK Platform Android 4.4 API 19 > ARM EABI v7a System Image
- Extras > Android Support Library
In the event that any of the above packages are listed as Not Installed, simply select the checkboxes next to those packages and click on the Install packages button to initiate the installation process. In the resulting dialog, accept the license agreements before clicking on the Install button. The SDK Manager will then begin to download and install the designated packages. As the installation proceeds, a progress bar will appear at the bottom of the manager window indicating the status of the installation.
Once the installation is complete, review the package list and make sure that the selected packages are now listed as Installed in the Status column. If any are listed as Not installed, make sure they are selected and click on the (Install packages) button again.