Click here to Skip to main content
15,881,757 members
Articles / Mobile Apps / Android

Setting Up Your Android Development Environment

Rate me:
Please Sign up or sign in to vote.
4.84/5 (25 votes)
21 Jul 2014CPOL7 min read 69K   52   16
This article will talk about how to setup Android Development Environment

Introduction

We are surrounded by technologies, gadgets and some of them have become our closest friends. We can stay away from our family for months but it's very difficult to live a single day without keeping in touch with these friends. :)

I feel lucky to be a part of this generation where we experienced so many revolutions in the fields of technology and smartphone is obviously one of the biggest revolutions of our era. Now, when we talk about smartphones, how can we stay away from Android! :)

Image 1

Popularity of Android phones is increasing day by day hence developing applications for Android OS is obviously on demand. Apart from smartphones and tablets, Android provides interfaces for televisions (Android TV), cars (Android Auto), wrist watches (Android Wear) and many more. To start developing android applications, you have to setup the environment first.

In this article, I'm going to talk about how one can setup Android Development Environment. I'll try my best to explain the steps comprehensively and concisely in this article and hope you enjoy the read! :)

System Requirements

Operating Systems

  • Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-bit)
  • Mac OS X 10.5.8 or later (x86 only)
  • Linux (tested on Ubuntu Linux, Lucid Lynx)
    • GNU C Library (glibc) 2.7 or later is required.
    • On Ubuntu Linux, version 8.04 or later is required.
    • 64-bit distributions must be capable of running 32-bit applications

Note: In this article, I'll consider Windows 8 (64-bit) operating system.

Development Tools

  • JDK 6 or greater version
  • Android Studio

Downloads and Installations

There are multiple tools available in the market to develop Android applications. As a beginner, anyone can easily get confused while choosing one out of all those options.

Image 2

In this article, we’ll talk about using Android Studio which provides everything you need to start developing apps, including the Android SDK tools and the Android Studio IDE (powered by IntelliJ) to streamline your Android app development.

But, before you set up Android Studio, be sure you have installed JDK 6 or greater (the JRE alone is not sufficient).

  • JDK – Let’s download the latest JDK available from the following link and then install:

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

Note: Make sure that you download the appropriate version (i.e. for 32-bit or 64-bit) for your system.

  • Android Studio – Download the latest version of Android Studio from the following link:

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

To set up Android Studio on Windows:

1. Let's launch the downloaded EXE file, android-studio-bundle-<version>.exe and click Next button

Image 3

2. Keep the default selection and click on Next button:

Image 4

3. Let's keep the default Destination Folder path and click Next button:

Image 5

4. Click Install button:

Image 6

5. Installation will start as shown below:

Image 7

6. Once the installation is completed, it will show the message > click Next button:

Image 8

7. Click Finish button to complete the installation:

Image 9

It will start Android Studio!

Note: After installation when you try to open Android Studio, the launcher script may not find where Java is installed and a popup is shown as follows:

Image 10

If you encounter this problem, you need to set an environment variable indicating the correct location (JDK).

Open System Properties from Control Panel > click System (or press Image 11+Image 12) > click Advanced System Settings > open Advanced tab:

Image 13

Click Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.8.0_11

Image 14

Android Studio is now ready and loaded with the Android developer tools, but there are still a couple packages you should add to make your Android SDK complete.

Adding SDK Packages

You have to download some packages using the Android SDK Manager before you can start developing.

  • Open Android Studio > click Configure option on Quick Start menu > click SDK Manager
  • You will see some of the packages are already selected. Let's keep them selected and select some other required Tools and Packages as shown below:
    • Android SDK Tools
    • Android SDK Platform-tools
    • Android SDK Build-tools (highest version available)
    • SDK Platform (under the latest Android x.x folder)
    • A system image for the emulator, such as ARM EABI v7a System Image
  • Click Install packages button to start installation of the selected tools and packages. 

Image 15

It'll show a popup once installations are completed:

Image 16

Now you're done setting up Android Studio and ready to build your first Android app!

Note: Make sure you download latest packages from SDK Manager when new tools/API would be available.

Creating Android Virtual Device (emulator)

Before we jump into developing Android application, first we've to create a virtual device (an emulator) where the application can run. Otherwise we can also run the apps on a real device.

In this article, we'll discuss how one can create an Android Vertual Device.

1. Let's launch AVD Manager by pressing Image 17+Q keys > type AVD Manager in App search > select AVD Manager from the searched result and press Enter key to open AVD Manager > click Create button

Image 18

2. Fill in the details for the AVD: Give it a name, select a Device, a platform target, and a skin (HVGA is default) >
Click OK.

Image 19

Note: You may find that the OK button is disabled. In case there is no system image is installed for the selected target, the OK button remains disabled. So, make sure that you select a Target for which system image (i.e. ARM EABI v7a System Image) is already installed. Otherwise you have to install the required system image from Android SDK Manager.

3. Select the new AVD from the Android Virtual Device Manager and click Start button

Image 20

4. This might take few minutes to boot up the emulator. Once it's ready just unlock the emulator screen.

Image 21

Bingo!!! our mission is acomplished! :)

Creating AVD from Device Definitions

In the above section, we saw how to create an Android Virtual Device by providing all the required details manually. There is another option available through which one can create an AVD quite easily.

1. Let's launch AVD Manager > click Device Definitions tab which will show a list of all known device definitions > select one device and click Create AVD button:

Image 22

2. Create new Android Virtual Device window will be opened with prepopulated values from the selected Device Definition > click OK button

Image 23

3. It will create the AVD and show a popup message as shown below:

Image 24

Tips and Best Practices

In this section, I'll point out some tips and best practices which can be helpful during setting up your Android Development Environment:

  • If the installation of SDK components fails, run the SDK manager as Administrator.
  • When installing any software mentioned in this guide, always make sure to install the version that is compatible with your OS version (32- or 64-Bit). Failure to do so may cause compatibility errors later on.
  • When installing the JDK or Android Studio, it's better to choose any drive other than C: drive. Simply the reason is that C: drive is generally used for OS and if you have to format C: drive due to any reason, you may have to setup all these again from scratch. This is just a tip and not a rule. :)

Conclusion

In this article, first we discussed about the systems requirements for Android applicaion development. Later on we saw what are the tools need to be downloaded and how to install Android Studio in step-by-step approach. Then we discussed about how we can add SDK packages using Android SDK Manager and finally discussed about how to create Android Virtual Device (emulator) using AVD Manager.

Hope you like this article. Please leave your comment/suggestion and don't forget to rate. Smile | :)

Points of Interest

Please visit the below link for more details:

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

History

  • 19th July, 2014: Initial version
  • 20th July, 2014: Added Tips and Best Practices section
  • 27th July, 2014: Added Creating AVD from Device Definitions section

License

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


Written By
Product Manager
India India
I'm Debabrata Das, also known as DD. I started working as a FoxPro 2.6 developer then there is a list of different technologies/languages C, C++, VB 6.0, Classic ASP, COM, DCOM, ASP.NET, ASP.NET MVC, C#, HTML, CSS, JavaScript, jQuery, SQL Server, Oracle, No-SQL, Node.Js, ReactJS, etc.

I believe in "the best way to learn is to teach". Passionate about finding a more efficient solution of any given problem.

Comments and Discussions

 
GeneralMy vote of 4 Pin
Muhammad Shahid Farooq16-Jun-16 1:00
professionalMuhammad Shahid Farooq16-Jun-16 1:00 
GeneralRe: My vote of 4 Pin
Debabrata_Das16-Jun-16 1:53
professionalDebabrata_Das16-Jun-16 1:53 
Questionvery good .article Pin
Sana Zafar7-Jan-16 19:37
Sana Zafar7-Jan-16 19:37 
AnswerRe: very good .article Pin
Debabrata_Das16-Jun-16 1:54
professionalDebabrata_Das16-Jun-16 1:54 
QuestionAndroid Virtual Device (AVD) Manager? Pin
RamNow29-Aug-14 9:05
professionalRamNow29-Aug-14 9:05 
AnswerRe: Android Virtual Device (AVD) Manager? Pin
Debabrata_Das30-Aug-14 16:46
professionalDebabrata_Das30-Aug-14 16:46 
GeneralRe: Android Virtual Device (AVD) Manager? Pin
RamNow31-Aug-14 0:06
professionalRamNow31-Aug-14 0:06 
GeneralRe: Android Virtual Device (AVD) Manager? Pin
Debabrata_Das7-Sep-14 7:34
professionalDebabrata_Das7-Sep-14 7:34 
GeneralMy vote of 5 Pin
Ranjan.D31-Jul-14 0:16
professionalRanjan.D31-Jul-14 0:16 
GeneralRe: My vote of 5 Pin
Debabrata_Das31-Jul-14 0:27
professionalDebabrata_Das31-Jul-14 0:27 
Questionalmost good Pin
Thornik22-Jul-14 11:58
Thornik22-Jul-14 11:58 
Except you put too much pictures for installing Studio. Dude, WE CAN install software! Smile | :)

> other than C: drive

Any reason for that?...
AnswerRe: almost good Pin
Debabrata_Das22-Jul-14 17:18
professionalDebabrata_Das22-Jul-14 17:18 
GeneralRe: almost good Pin
Thornik23-Jul-14 0:35
Thornik23-Jul-14 0:35 
GeneralRe: almost good Pin
Debabrata_Das23-Jul-14 3:31
professionalDebabrata_Das23-Jul-14 3:31 
GeneralGood luck! Pin
Kevin Priddle21-Jul-14 6:01
professionalKevin Priddle21-Jul-14 6:01 
GeneralRe: Good luck! Pin
Debabrata_Das21-Jul-14 6:16
professionalDebabrata_Das21-Jul-14 6:16 

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

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