Android Studio Installation
Step 1 - System Requirements
Android application development can be started on the following operating systems:
Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit).
Mac® OS X® 10.8.5 or higher
GNOME or KDE desktop
All the tools required for developing Android applications are open-source and can be downloaded from the internet. Below is a list of software needed before starting Android application programming:
Java JDK5 and later versions
Java Runtime Environment 6
Android Studio
Step 2 - Installing Android Studio
Overview
Android Studio is the official IDE for Android application development, based on IntelliJ IDEA. You can download the latest version of Android Studio from the official website Android Studio Download. If you are a beginner installing Android Studio on Windows, find the file named android-studio-bundle-135.17407740-windows.exe
to download and run it through the Android Studio wizard guide.
To install Android Studio on Mac or Linux, you can download the latest version from Android Studio Mac Download or Android Studio Linux Download and follow the instructions provided with the download. This tutorial assumes you are installing your environment on a Windows 8.1 operating system.
Installation
Ensure that Java JDK is installed before installing Android Studio. To install Java JDK, refer to the section Java Development Environment Setup.
Once you start the Android Studio installation, you need to set the JDK5 or later version path in the Android Studio installer.
The following image shows the initialization of JDK for Android SDK.
Check the components required to create an application, the image below selects "Android Studio", "Android SDK", "Android Virtual Machine", and "Appearance (Intel chip)".
Specify the paths for Android Studio and Android SDK on your local machine. The image below shows the default installation location on a Windows 8.1 64-bit architecture.
Specify the default RAM space required for the Android emulator as 512M.
Finally, extract the SDK package to your local machine, which will take some time and occupy 2626M of hard disk space.
After completing the above steps, you will see an end button and can open an Android Studio project from the welcome screen, as shown below:
Start Android application development by initiating a new Android Studio project. On the new installation page, you are asked to fill in the application name, package name information, and project path.
After entering the application name, start selecting the environment parameters for the application, where you need to specify the minimum SDK. In this tutorial, we choose API 21: Android 5.0 (Lollipop).
The next step requires selecting the activity for the mobile device and specifying the default layout for the application.
The final stage opens the development tools to write the application code.
Step 3 - Creating an Android Virtual Device
To test Android applications, an Android Virtual Device (AVD) is needed. Therefore, before writing code, create an Android Virtual Device. Click the AVD Manager icon in the image below to launch the Android AVD Manager.
After clicking the virtual device icon, the default virtual devices in the SDK will be displayed. Click the "Create new Virtual device" button to create a virtual device.
If the AVD creation is successful, this means you are ready for Android application development. Click the close button in the upper right corner to close the window. After completing the last step, restart your machine. Before starting your first Android example, you need to understand some concepts related to Android application development.
Hello World Example
The specific code is as follows:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<TextView android:text="@string/hello_world"
android:layout_width="550dp"
android:layout_height="wrap_content" />
</RelativeLayout>
Click Run > Run App to run the program, and the result is as follows: