Weeks ago I Plunged into the world of Android App Development. Sometimes the Instructions given are not Straight forward, causing little bit of trouble for “rote memorizers” or in industry lingo “fresher’s”. Setting up DE(my shorthand for Development Environment) for Android is akin to “cooking”!.You need some ingredients and need to follow the process.
The things required for setting up Android development environment are.
[Note:* links take you to appropriate download pages for you to download version appropriate for your system.
**ADT link downloads 20.0.0 version of the plugin to your system directly, better use alternate link given below to download it]
All the Apps for Android are written in Java. Along with it the ADT, SDK, and Eclipse are written in Java and require Java Runtime to work. Hence JDK is most important ingredient.
The UI of Android apps is written in XML and Logic is written in Java. The code required for a simple “Hello World!” android app would run into 100’s line of code. Since there is huge amount of coding is involved in android its necessary for one to use an IDE. Since “Eclipse” is the most popular IDE for Java and also It supports plugins, to extend its functionality, it is used widely in Android App development too.
The Apps in Android are written in java language but android doesn’t support Java Classes, and also since android apps run on custom built Dalvik VM, Android has its own set of Libraries along with Libraries from other vendors. Hence Its necessary to install Android SDK. (note:The SDK tools installer downloads only the tools and Virtual Device manager to reduce the download size. platforms, documentation etc. have to be downloaded separately)
The Android ecosystem is constantly developing, hence its documentation and API’s are constantly upgraded. Also AVD (Android Virtual Device) uses Android System Image, All these consume huge amount of Disk space (mine is using 7GB and has almost all Tools and API’s). In order to manage this huge download, SDK Manager is given which checks for Update to tools and also New API’s. All the Platforms, Packages has to be downloaded by SDK Manager only.
Eclipse doesn’t support the Android Development out of the box. It requires plugins to support development. ADT is the official plugin to do this. ADT Helps in connecting Eclipse IDE to Android SDK. Also helps us to manage AVD’s and SDK’s.
Setting up a.k.a “Cooking” Android:
Now we shall set up the Development Environment.
Step1: Install the JDK
Download the JDK from Oracle[link:http://www.oracle.com/technetwork/java/javase/downloads/index.html]
Once download install the JDK, in your system.
Once installed add the JDK Installation Folder to environment variable Named “Path”. (Note: this path setup is not mandatory if you are using eclipse, but it is good to do so.)
Images below illustrate how to do this.
Right click on my computer and go to properties.
Then in advanced Tab, click on Environment Variables.
Search for Path variable and click on edit.
Then add the JDK installation path to the end(varies from system to system). (Note:Make sure to put semicolon before pasting directory address.) the java compiler is located in “bin” folder of JDK, hence paste that path not just “C:jdk” in above case.
Step 2: Installing Eclipse
Once the download is complete extract the contents of archive to a folder using archive manager such as WinZip, WinRAR, or other archive managers.
(Hint: Eclipse is very powerful IDE, and it has some concepts associated with it. Even though you can use eclipse without knowing this concepts but its advised to know these concepts so that you can take full advantage of the IDE.) Visit this link to know about Eclipse IDE (Eclipse IDE Tutorial). This link contains article from Lars Vogel – Eclipse and Android Evangelist.
Step 3: Installing SDK
Download the SDK from given download link [link:http://developer.android.com/sdk/index.html] Once downloaded run the installer. The installer checks for JRE version and after that it Prompts to select the install location.(Hint: Its better to choose custom location as the location must be given during the installation of ADT)
(Note: The SDK contains only “core” tools which can used to download rest of SDK Packages)
Once SDK is installed run the SDK Manager in “Administrative” Privileges by right clicking the “
SDK Manager.exe” and choosing Run as Administrator. (Note: Windows XP Users need not worry about this, This is required for Vista and 7 users only) and proceed to next step.
Step 4: Installing Platform and Packages
Once the SDK Manager runs it checks various package download sites for System Images, Documentation, Sample Code, API’s. Download the packages you require. System Image is necessary to run AVD. API’s are required for developing apps which use those. (Ex:- Motorola API’s are useful if you develop apps exclusively targeted at Motorola Devices)(Note: I have downloaded all the components and API’s including Sample Codes, hence I have monstrous download size of 7GB). If you downloaded the files of Jelly Bean including the sample code the file size was around 1GB. Once the download is complete you can proceed to next step of Installing ADT.
Step 5: Installing ADT Plugin
ADT installation can be done in many ways. The different methods are
- Adding a link of online repository to check.
- Downloading the ZIP file of plugin and Updating Eclipse
- Copying individual “.jar” files from archive and pasting it in “dropins” folder.
Copy the .jar files available in the downloaded
ADT_____.zip file and paste them in dropins folder found in extracted eclipse folder(shown in diagram).
After copying run
eclipse.exe, which will automatically install them.
Online Repository Method
We can add the add the link of Online Repository in
Help->Add New Software. Following images shows them step by step.
this is step 1.
Then in dialog box click on add as shown by arrow.
- Then in location paste the following URL.
- After pasting click on OK. and Eclipse will download and installs it and automatically restarts.
Instead of pasting location click on “Archive” and browse for the ADT plugin location and open the file. After opening the file following dialog is displayed.
make sure the option contact all update sites during install to find required software is selected. and click on next.
- On next dialog click on “select all” and hit next.
- Then it presents you with licence agreement, click on radio button of “i agree” and hit finish.
- while installing it may show some warning regarding “software not authentic” just click on OK.
- After installing the plugins, eclipse will automatically restarts. (If it doesn’t do it yourself)