Android Tutorial: Environment Setup

You need the Android Software Development Kit (SDK) to develop, debug and test your applications. The SDK contains various tools including an emulator to help you test your applications without a physical device. Currently, the SDK is available for Windows, Mac OS X and Linux operating systems. See more about android os (wiki).

Environment Setup

You also need an integrated development environment (IDE) to speed up development. You could build applications without an IDE, but that would be more difficult and unwise. There are two IDEs currently available, both free:

  • Android Studio, which is based on IntelliJ IDEA, a popular Java IDE. This software suite includes the Android SDK.
  • The Android Developer Tools (ADT) Bundle, is a bundle that includes the Android SDK and Eclipse. Eclipse is another popular Java IDE.

Released in December 2014, Android Studio is the preferred IDE and the ADT bundle will not be supported in the future. Therefore, you should start using Android Studio unless you have very good reasons to choose the ADT Bundle. This book assumes you are using Android Studio.

In this chapter, you will learn how to download and install Android Studio. After you have successfully installed the IDE, you will write and build your first Android application and run it on the emulator.

Android application development requires a Java Development Kit (JDK). For Android 5 or later, or if you are developing using Android Studio, you need JDK 7 or later. For pre-5 Android, you need JDK 6 or later. If you do not have a JDK installed, make sure you download and install one by following the instructions in Appendix A, “Installing the JDK.”

Downloading and Installing Android Studio

You can download Android Studio from this web page:

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

Android Studio is available for Windows, Mac OS X and Linux. Installing Android Studio also downloads and installs the Android SDK.

Installing on Windows

Follow these steps to install Android Studio on Windows.

1. Double-click the exe file you downloaded to launch the Setup wizard. The welcome page of the wizard is shown in Figure 1.1.

The Android Studio Setup program

Figure 1.1: The Android Studio Setup program

2. Click Next to proceed.

Choosing components

Figure 1.2: Choosing components

3. You will see the next dialog of the Setup wizard as shown in Figure 1.2. Here you can choose the components to install. Leave all components selected and click Next again.

License Agreement

Figure 1.3: License Agreement

4. The next dialog, shown in Figure 1.3, shows the license agreement. You really have no choice but to agree on the license agreement if you wish to use Android Studio, in which case you have to click I Agree.

Choosing the install locations

Figure 1.4: Choosing the install locations

5. In the next dialog that appears, which is shown in Figure 1.4, browse to the install locations for both Android Studio and the Android SDK. Android Studio should come with suggestions. It’s not a bad idea to accept the locations suggested. Once you find locations for the software, click Next.

Emulator setup

Figure 1.5: Emulator setup

6. The next dialog, presented in Figure 1.5, shows the configuration page for the emulator. Click Next.

Choosing the Start menu folder

Figure 1.6: Choosing the Start menu folder

7. The next dialog, shown in Figure 1.6, is the last dialog before installation. Here you have to select a Start menu folder. Simply accept the default value and click Install. Android Studio will start to install.

Installation complete

Figure 1.7: Installation complete

8. Once installation is complete, you will see another dialog similar to that in Figure 1.7. Click Next.

Setup is finished

Figure 1.8: Setup is finished

9. On the next dialog, shown in Figure 1.8, click Finish, leaving the “Start Android Studio” checkbox checked. If you have installed a previous version of Android Studio, the Setup wizard will ask you if you want to import settings from the previous version of Android Studio. This is shown in Figure 1.9.

Figure 1.9: Deciding whether to import settings from another version of Android Studio

10. Leave the second radio button checked and click OK. The Setup wizard will quietly create an Android virtual device and report it to you once it’s finished. (See Figure 1.10).

The Setup wizard has just created an AVD

Figure 1.10: The Setup wizard has just created an AVD

11. Click Finish. Finally, Android Studio is ready to use. The welcome dialog is shown in Figure 1.11.

Figure 1.11: Android Studio’s welcome dialog

Installing on Mac OS X

To install Android Studio on a Mac OS X machine, follow these steps:

1. Launch the dmg file you downloaded.

2. Drag and drop Android Studio to the Applications folder.

3. Open Android Studio and follow the setup wizard to install the SDK.

Installing on Linux

On Linux, extract the downloaded zip file, open a terminal and change directory to the bin directory of the installation directory and type:

./studio.sh

Then, follow the setup wizard to install the SDK. Next Article: Android Tutorial: The Application Structure

Summary

Our environment has changed. In the next tutorial, we will create a project.

Leave a Reply

Your email address will not be published.