Android Studio Installation



Why Develop For Android?

With over 1 billion Android devices already activated, Android represents an incredible opportunity for developers. Android Studio is a latest and most widely accepted IDE designed by Google itself. If you want to develop apps in android then it is highly recommended to use Android Studio.


Quick Overview

A typical native android application is written using XML for the frontend (the User Interface) and JAVA for the backend.


JAVA All the programming part in android development is done using JAVA. Although it’s a great advantage, if you know a thing or two about programming in Java, but even if you know any object oriented programming language, then it will not be much difficult to relate to the concepts used during development. In short if you know C++ or C then also you are at peace.


XML This is used to build the app’s user interface. All user interface elements in an Android app are built using View and ViewGroup objects. It has drag and drop User Interface


Running the app An android application can run either on your device or in the emulator that comes bundled with the SDK. Since the emulators can be slow, it is always recommended to use an actual device. This link contains the detailed explanation for setting up your device/emulator for testing.


Installation of Android Studio#


JDK and JRE are essential for JAVA to run on your machine.

For windows:

(linux users click here)

Installing JAVA

Follow the link and click Java Platform (JDK) 8u144 photograph. It redirects to a new page on which select Accept the license and download the version which is best suited with your machine. After installing the JDK, you need to set the environment variable JAVA_HOME path and for that:

  1. For this, right-click on the ‘This PC’ icon on your desktop and select ‘Properties’. On the next screen that appears, go to ‘Advanced system settings’ item. On the ‘System Properties’ window that appears, select the ‘Environment Variables’ button.
    System Properties

  2. The ‘Environment Variables’ window will appear (see figure below). Click on the ‘New…’ button.
    Environment Variables

  3. The ‘New System Variable’ window will appear (see the figure below). Enter ‘JAVA_HOME’ as the variable name andC:\Program Files\Java\jdk1.8.0_144’ as the variable value. Then click the ‘OK’ button.
    New System Variable

  4. Scroll down the ‘System variables’ window until you see the ‘Path’ item, then click on it. Then click on the ‘Edit…’ button. The ‘Edit Environment Variable’ window will appear. Click on the ‘new’ button then type the following into the field that gets highlighted:

  C:\Program Files\Java\jdk1.8.0_144\bin\

The completed screen will look something like this:

Edit Environment Variable

For reference, one can visit this link

Installing IDE


• Go to this link and select “Download Android Studio for Windows”.

• Check the “ I have read and agree with the above terms and conditions” box and Download Android Studio For Windows.

• Install studio after downloading.

• Open the Android Studio. A window similar to the below one would appear.

New Project

• Click on configure and choose SDK Manager in drop down menu.

Configure

Install following packages

Configure

Head to recommended section for things you’ll need for this lecture


Linux Users

Installing JAVA

Open your terminal using Alt + Ctrl + T (or by searching for terminal) and enter commands below in order to install JDK and JRE.

Step 1: Update package list

sudo apt-get update

Step 2: Install JRE and JDK

sudo apt-get install default-jre  default-jdk  oracle-java8-installer

Step 3: Configure Java

sudo update-alternatives --config java

Step 4: Set environment variable replacing YOUR_PATH with path which last command returned

sudo vim /etc/environment – add JAVA_HOME="YOUR_PATH"

Step 5:

source /etc/environment

For reference you can visit this link.

If there is still some error, you can also refer to here


Installing IDE


  1. Follow this link -> select All Android Studio Packages -> Linux. This will start the download.

  2. Extract the file where you want to install Android Studio.

  3. In terminal type:

    cd /{Location where you extracted}/android-studio/bin
    

    and then

    sh studio.sh
    

• Open the Android Studio. A window similar to the below one would appear. Select configure in it. New Project

• Click on the SDK Manager icon (containing android and a down arrow).

Configure


• Install the following packages
SDKtools

Bring your USB cable so that you can test application on your own device!

(For first time users)

  1. Ensure an interent connection on your machine
  2. Start Android Studio
  3. Click Start a new Android Studio Project
  4. On screen Configure you new project leave default options and click Next
  5. Leave default options unchanged and click Next.
  6. Select Empty Activity and click Next.
  7. Leave default options unchanged and click Finish.
  8. If Android Studio asks allow it to download additional content.

These steps are necessary for first time user to ensure everything is downloaded when you come to the lecture.

(For linux users only)
Adding shortcut to android studio in launcher/desktop: How to add Android Studio to the launcher?

Some Common errors:

thenewboston : Youtube channel to get you started.

Some basic links to grasp a bit of more knowledge:

For any queries feel free to ask down in comments or chat with us !




We new friends!