Android Studio

0
2218

Android Studio is Android’s Integrated Development Environment (IDE) which helps Android developers to build high-quality apps which supports Android platform. This IDE facilitates Android developers by providing easy to use tools like an enriched source code editor, debugger, tester, and various automation tools. This powerful IDE is created using the IntelliJ IDEA software.

Here, we will help you to configure and install Android Studio on your computer system.

Also Read: Android Application Components

Check For The System Requirements

For the convenience of the application developers, Android Studio supports various operating systems. So, if you are an Android application developer then you can choose any of the listed operating systems for the installation of this Android IDE.
* Microsoft Windows 2003/Vista/7/8/10 (either 32- or 64-bit would do)
* Mac OS (from 10.8.5 to any of the higher versions till 10.9, Mavericks)
* GNOME or K Desktop Environment (here, K stands for Kool)
After choosing a suitable operating system, you need to look for the appropriate tools to minimize your workload. For this, you can opt for any of the below-mentioned open source tools which are easily available on the Internet. You can easily download and install these tools.
* Java SE Development Kit (JDK5 or higher versions)
* Java Runtime Environment (JRE 6 or higher versions)
* Android Studio

How to setup Android Studio?

Well, before we start with the set up of the Android Studio, you must be aware of the fact that the latest version of this IDE i.e., Android Studio Version 3.x needs a bit different system requirements which are provided below.

Criterion Description Remarks
OS Version * Microsoft Windows: 7/8/10 (32- or 64-bit)
* Mac OS: 10.0 (Yosemite) to 10.13 (macOS High Sierra)
* Linux: GNOME or KDE
RAM A minimum of 3 GB
(additional 1 GB for Android Emulator)
Recommendation: A minimum of 8 GB
Available Disk Space A minimum of 2 GB of free disk space
(additional 500 MB for Android Studio IDE and 1.5 GB for Android SDK and Android Emulator system image)
Recommendation: A minimum of 4 GB
JDK Version JDK 8

 

Once you are ready with the above-mentioned system requirements, you can download the latest version of Android Studio, which is Android Studio 3.0.1. On this web page, you will get the Android Studio package for all of the platforms supporting every possible size. You would also be able to download Android Studio SDK from here.

In this tutorial, we will be using Microsoft Windows 8.1 for the whole installation process.

How to install Android Studio?

Before you start with the installation of Android Studio, your computer system must have Java JDK installed in it. But, if you don’t have Java JDK in your system then you can go through our Android Environment Setup module where you can find the steps to install Java JDK. After all of the prerequisites in hand, you can follow the given steps.
Step 1: Locate the AndroidStudio.exe executable file and launch it. After the launch of this file, you need to hit the Next button.

Step 2: After hitting the next button, the Android Studio installer will prompt you to enter the path of the Java Development Kit (JDK). In this case, we will be using JDK7.

Once you click on the Browse… button, you will be displayed with the following dialog box where you need to select the appropriate JDK7 path.

Step 3: After this step, you will be asked to select the Android Studio components as per your requirement. Keep in mind that you need to select all the components as all of these will be helpful in the Android application development. So, you will be selecting all the components which include Android Studio, Android SDK, Android Virtual Device, and Performance (Inter chip).

Step 4: After this step Android Studio Setup, you will be asked to enter the local machine path for both the Android Studio and Android SDK. As mentioned in the below figure, ensure that the specified location must have a minimum of 500 MB of available disk space.

Step 5: After setting up the local machine path, you are required to specify the RAM space for the Android Emulator. It accepts 512 MB of space by default.

Step 6: At the final step of the setup, the Android Studio will start installing by extracting all the available SDK packages. This last step will be time-consuming so you need to be patient with it.

How to create a new Android Studio project?

This section is a continuity of the previous section which means that we are assuming that you will be starting your new project just after the installation of the Android Studio in your computer system.

Step 7: By the time you hit the Finish button, you will end up with a welcome message.

Step 8: Click on Start a new Android Studio project. The other frame will appear on the screen where you need to input the Application name, Company domain, Package name, and Project location.

Step 9: After entering the Application name, you will be called to select the form factors. These form factors are required to be selected to run your application on. Here, you need to mention Minimum SDK separately for phone and tablet, wear, TV, and Glass. Well, here, we are using API23: Android 6.0 (Marshmallow).

Step 10: After you select the Next button, you need to add the activity to Mobile. You can choose any of the provided application layouts.

Finally, a development tool will appear on the screen where you can write the code for your Android application.

How to create an Android Virtual Device?
Android Virtual Device will be used whenever you are required to test your Android application. So, it would be better if you create an Android Virtual Device before you start with your application coding. So, to begin with the creation of an Android Virtual Device, you need to launch Android AVD Manager on your Android Studio software. To locate this AVD Manager, you can refer to the given screenshot where the icon has been highlighted for your convenience.

After clicking on it, you will be displayed with the already existing (default) virtual devices. All of these default virtual devices are already present on your Android SDK. Well, here, you need to create a new virtual device by clicking on the Create Virtual Device button.

After the successful creation of your new Virtual Device, you can start will the application programming.

Note: It is recommended that you close this current window and restart your system so that the changes can take place evidently.

Start With Hello World Application
Now, just to test whether everything is in place, you should start with a basic programming code. It would be better if you choose the Hello World application to know about the XML tags. Follow the below-mentioned steps to write the Hello World code.

Step 1: Redirect your application to App>res>layout>Activity_main.xml.

Step 2: To display the text “Hello World”, you need to call for text view with a layout. You can understand this clearly with the provided lines of code.

<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>

Step 3: The last step is to compile this code. Well, to run this application code you can either click on Run -> Run App or press Shift + F10 key. The final result would look like the following.