Click here to Skip to main content
Click here to Skip to main content

Article 2 - Setting Up Your Android Development Environment

, 4 Aug 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
In this article you will be learning how to set up your android development environment, Creating android virtual device. Also you will see a comparison about Eclipse vs Android.

Introduction

This article is all about setting up your development environment with the the required software for developing android apps. The following topics are covered in this article.

•    Comparison of the new Android Studio vs. Eclipse IDEs
•    Step-by-step guide on setting up a basic development environment
•    Creating your first Android Virtual Device (emulator)
•    Other tips and best practices

Background

Please refer the below mentioned article to understand the basics about Android.

http://www.codeproject.com/Articles/802449/Article-Introduction-to-Android


Android Studio vs. Eclipse IDEs 
 

Let us briefly see about the new Android and Eclipse IDE.  The whole comparison is done based on the pros and cons of the IDE’s. 

Android studio is based on JetBrains’ IntelliJ IDEA. It’s an open-source which is being managed by Google. It provides an integrated Android developer tools for development and debugging apps.

Pros: 

  • Powerful refactoring capabilities.
  • Consistent in terms of UX.
  • Shortcuts for almost every action.
  • Static code analysis. This is very important to keep your code clean and bug free.
  • Built in source code previewing.
  • Live UI rendering capabilities.
  • More stable and much faster than eclipse. 
  • The best code completion and inspection.
  • Rich GUI is pretty awesome with drag and drop UI components. Usability wise, it’s easy to learn.
  • Debugger is pretty faster.
  • Repository integration is much easier (better GUI) and is more reliable. 
  • Lint tools to catch performance, usability and version compatibility etc. problems.
  • One can make use of “Gradle” build system to easily automate building, testing, publishing and deployment.
  • Amazing feature of 'Preview All Screen Sizes' or toggle between different orientations, themes and platform versions.

Cons:

  • Minimal plugins support. Offers nearly 947 plugins.
  • Multiple projects supported but not effectively handled as eclipse does.


Eclipse is one of the most popular IDE which is been around since from year 2001 and lots of people do love coding using Eclipse. It’s mainly used by Java developers; however eclipse is just not limited to java programming, you can add packages for programming other languages like PHP, C/C++. 

Pros:

  • One of the greatest advantages of using eclipse is, it has a whole lot of plugins. Eclipse offer more than 1,276 plugins.
  • Multiple language support.
  • Handles large projects faster.
  • Multiple projects are handled very well.

Cons:

  • Slow and ugly.
  • Search and autocomplete is poor.
  • Eclipse requires huge amount of memory to run and in addition to that, it requires huge disk space too.
  • Requires massive amount of CPU power.
  • Crashes and hangs often. 
  • Updating to newer version is yet times painful. 

Eclipse and Android Studio terminology differences

EclipseAndroidStudioTerminologies


Step-by-step guide on setting up a basic development environment


Let us try to understand the operating system requirements.


Operating System Requirement
 

1.    Windows XP (32-bit or later version.

2.    Mac OS X 10.5.8 or later (x86 only)

3.    Linux (tested on Ubuntu Linux, Lucid Lynx). GNU C Library (glibc) 2.7 or later is required.

4.    On Ubuntu Linux, version 8.04 or later is required.


Development tools


At least JDK 5/6. Note - JRE alone is not sufficient.

Here is the list of steps in setting up your environment for developing Android Apps.

1.    Install Java SDK (If not installed)

http://www.oracle.com/technetwork/java/javase/downloads/index.html

here’s the environment variable settings for Windows and Linux OS that one has to do or verify the same.

a) Start menu > Computer > System Properties > Advanced System Properties. 

b) Open Advanced tab > Environment Variables and add or update the system variable value for JAVA_HOME and PATH, point to your JDK folder; Example C:\Program Files\Java\jdk1.7.0_21.

EnvironmentVariableSettings

On Linux, say if the SDK is installed in /usr/local/jdk1.6.0_15, use our C Shell and then you should put the following code into your *.cshrc file.

setenv PATH /usr/local/jdk1.6.0_15/bin:$PATH

setenv JAVA_HOME /usr/local/jdk1.6.0_15

 

2.    Get the Android SDK

The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android.

If you are a beginner, here’s the link to download Eclipse ADT with the Android SDK for windows so that you can quickly developing apps. It has everything that’s required to get started. That’s IDE + Android developer tools.

https://developer.android.com/sdk/index.html#win-bundle

If you prefer to use your existing IDE say Eclipse or any other IDE, then you can just download the Android SDK alone.  Here’s the link, you can navigate to “View all downloads and sizes” and then download the most suitable package for your environment.

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

3.    Now it’s the time to install IDE for development. Either you can go by installing “Eclipse ADT” from the below mentioned link. Please note that this step is not required those of you have downloaded “Eclipse ADT with the Android SDK” in step 2.

https://developer.android.com/sdk/installing/index.html?pkg=adt

Or you if you wish to try out installing Android Studio, then you can install the same from the below mentioned link

https://developer.android.com/sdk/installing/index.html?pkg=studio


Eclipse ADT


Assuming you have followed the above mentioned step for downloading Eclipse ADT. You will have to extract and navigate to the eclipse folder in bundle, and then you can open up the eclipse IDE for development. 

Eclipse_ADT


Android Studio

Let us now see how to install Android Studio. First one has to download Android Studio from the below mentioned link

https://developer.android.com/sdk/installing/studio.html

DownloadAndroidStudio

Windows:

Launch the downloaded EXE file, android-studio-bundle-<version>.exe. Coming next you will see how to install Android Studio in five steps.

Mac OS X:

Open the downloaded DMG file, android-studio-bundle-<version>.dmg
Move or drag and drop Android Studio into the Applications folder.

Note - If you are warned with a message stating "package is damaged and should be moved to the trash", then go to System Preferences > Security & Privacy and under Allow applications downloaded from, select "Anywhere"

Linux:

Unpack the downloaded Tar file, android-studio-bundle-<version>.tgz, into an appropriate location for your applications.

Android Studio can be launched by navigating to “android-studio/bin/” directory in a terminal and executing studio.sh.

Note – If you wish to start android studio from any directory then please go ahead and add android-studio/bin/ to your PATH environmental variable.
 

Installing Android Studio in Windows 


Here are the five steps to install android studio. Though it’s straight forward, I wish to show these steps for beginners.

1.    Right click on the installer “installer_r23.0.2-windows.exe” and run as Administrator. You will see the below screen. 

AndroidSDKSetup1

2.    Click on next, you will see the below screen were the android studio will auto detect the Java SE Development Kit installed on your machine and it will show up the location where it’s installed.

AndroidSDKSetup2

3.    Click next to choose users. If you are trying to install for all users of your computer then you can select first radio button “Install for anyone using this computer” else select Install just for me option.

AndroidSDKSetup3

4.    Click on next to choose the location where you want to install. You can leave the default location.

AndroidSDKSetup4

5.    Click on next button, you will see a screen to choose start menu folder; you can leave as it is. Then click on “Install” button to get started with installing android studio.

AndroidSDKSetup5

Installing Android Development Tools for Eclipse 

Let us see how to install android development tools for eclipse.  The following steps are required say if you already have eclipse installed on your system.

1.    You will have to choose "Help" and then "Install New Software…."

2.    Click the “Add…” button, it will show up a screen to Add Repository. Just key in the name and location as below.

Name: "Android ADT" (Your own personal use, name it as you wish) 
Location: "https://dl-ssl.google.com/android/eclipse/" (use http if https does not work for you)

3.    Check all the boxes to install all the tools. Click on next button and proceed with the installation. In the end, the installer will ask you to restart.

4.    Go ahead and restart Eclipse.

Setting up the Required Packages

Once you have successfully installed Android SDK in step 1, we will install the packages that we need in here. 
You can navigate to the installed Android SDK folder and then click on "SDK Manager.exe&q

AndroidSDKManager


Or say you can directly do the same from Android Studio. Please refer the below screen in order to install the suitable Android API’s.
 

SetupAndroidSDK

Creating your first Android Virtual Device (emulator)

Click on the AVD Manager icon, to open up the android virtual device manager.

AVDManger1

You should see something like below.

AVDManger2

Click on “Create” button, to get started in creating virtual device. 

1. Key in the virtual device name.

2. Select the device. 

3. Select the suitable target, the CPU/ABI will be set by default upon selection of target.

4. Keyboard option is by default checked. You can leave as it is.

5. Select the skin.

6. For memory option, do not set the RAM size greater than 768 as the emulator might fail to run with higher RAM size.

7. Save to snapshot option causes the emulated device state to be saved to a snapshot upon device exit, when checked.


AVDManger3

When you click on “OK” button, you should see the result of creating a virtual device.

AVDManger4

As shown in the below screen, select the android virtual device and then click on "Start"

AVDManger5

You should be able to see the virtual device running. In below, you will notice the device is running with a value 5554 which is nothing but a console port were you can use to query and control the virtual devices environment. Note - Android supports up to 16 concurrently executing virtual devices. 

AVDManger6

Other tips and best practices

Those of you working in Eclipse or Android Studio IDE’s, you will feel more comfortable in working with those and have a strong feeling towards it. You have a choice to pick one of the IDE’s for development. Say if you are more comfortable in using Eclipse as a Java developer and if you feel you will be fine in using the same for Android App development, please feel free to go with it.

While installing the Android Studio, do not download the canary build as it tends to be quite buggy.

Make sure you have sufficient space for emulator to run. And please do not set the memory options of the emulator too high, you might end up not seeing the emulator running on your machine.

To verify the list of android packages installed on your machine, please run the following batch file on your command prompt. 

Navigate to your Android SDK installation folder , ex: C:\Program Files (x86)\Android\android-sdk\tools and run android.bat file. It will pop up the Android SDK manager and will show all the packages installed on your machine.

Android Studio installation fails wtih no JDK found. Adding environment variable JAVA_HOME => C:\Program Files\Java\jdk1.7.0_21.  If you are using Windows 7, set the JDK_HOME environment variable.

When you click on "New Project" , you may encountered the error stating "Your Android SDK is out of date or is missing templates. Please ensure you are using SDK version 22 or later". The solution is to install new updates using SDK manager and restart the IDE.

Lazy and quik steps to install android studio on 
Mint, Ubuntu and other Ubuntu based Linux operating system. (Source - http://thenepalidroidguy.blogspot.com/2014/05/how-to-install-android-studio-easily-via-ppa-in-linux.html)

1. Open up terminal window
2. Key in sudo apt-add-repository ppa:paolorotolo/android-studio and hit enter.
3. Key in  sudo add-get update and hit enter.
4. Key in sudo apt-get install android-studio and hit enter.

Points of Interest

I was extreamly happy about the easiness with the installation process. Just a matter of following few steps, I was able to install and get everything up and running with no issues. Android studio installation happens with just 5 clicks and you don't have to do configure much. Also for the first time when I was creating a android virtual device, I felt it was easy enough to follow some basic steps to create one. 

Please refer the below link for all the latest Software, SDK and other changes in the installation process

https://developer.android.com/sdk/installing/studio.html

History

Version 1.0 - Created initial version of article explaning the steps required for setting up the development environment - 08/03/2014

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ranjan.D
Web Developer
United States United States
Profile
 
Around 10 years of professional software development experience in analysis, design, development, testing and implementation of enterprise web applications for healthcare domain with good exposure to object-oriented design, software architectures, design patterns, test-driven development and agile practices.
 
In Brief
 
Analyse and create High Level , Detailed Design documents.
Use UML Modelling and create Use Cases , Class Diagram , Component Model , Deployment Diagram, Sequence Diagram in HLD.
 
Area of Working : Dedicated to Microsoft .NET Technologies
Experience with : C# , J2EE , J2ME, Windows Phone 8, Windows Store App
Proficient in: C# , XML , XHTML, XML, HTML5, Javascript, Jquery, CSS, SQL, LINQ, EF
 
Software Development
 
Database: Microsoft SQL Server, FoxPro
Development Frameworks: Microsoft .NET 1.1, 2.0, 3.5, 4.5
UI: Windows Forms, Windows Presentation Foundation, ASP.NET Web Forms and ASP.NET MVC3, MVC4
Coding: WinForm , Web Development, Windows Phone, WinRT Programming, WCF, WebAPI
 
Healthcare Domain Experience
 
CCD, CCR, QRDA, HIE, HL7 V3, Healthcare Interoperability
 
Others:
 
TTD, BDD
 
Education
 
B.E (Computer Science)
 
CodeProject Contest So Far:
 
1. Windows Azure Developer Contest - HealthReunion - A Windows Azure based healthcare product , link - http://www.codeproject.com/Articles/582535/HealthReunion-A-Windows-Azure-based-healthcare-pro
 
2. DnB Developer Contest - DNB Business Lookup and Analytics , link - http://www.codeproject.com/Articles/618344/DNB-Business-Lookup-and-Analytics
 
3. Intel Ultrabook Contest - Journey from development, code signing to publishing my App to Intel AppUp , link - http://www.codeproject.com/Articles/517482/Journey-from-development-code-signing-to-publishin
 
4. Intel App Innovation Contest 2013 - eHealthCare - http://www.codeproject.com/Articles/635815/eHealthCare
 
5. Grand Prize Winner of CodeProject HTML5 &CSS3 Article Contest 2014
 
6. Grand Prize Winner of CodeProject Android Article Contest 2014

Comments and Discussions

 
GeneralMy vote of 5 PinmemberAbhishek Nandy5-Aug-14 7:38 
GeneralJava SDK download link PinmemberJefferys4-Aug-14 13:56 
GeneralRe: Java SDK download link PinmvpRanjan.D4-Aug-14 14:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141223.1 | Last Updated 4 Aug 2014
Article Copyright 2014 by Ranjan.D
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid