View Course Path

Introduction to Android Studio and running your first program

What will you learn?

  1. A basic introduction to Android Studio and starting a new Android Studio project and configuring its details
  2. Creating a new Virtual Device and deploying your project on it

Android Studio is the official integrated development environment (IDE) for Android apps. Google announced it in the I/O conference in May 2013, and since then, it has retired Eclipse. Although still in use, developers have moved to the native Android Studio for more flexibility and faster updates.

How to Download and Install Android Studio?

You can download the Android Studio bundle from the official website. The website will automatically detect your system and give you the bundle best suited for your system.

But if you still want to download other versions, perhaps to install it on a different system, then you can scroll down to the bottom of the page and find all different versions. At the time of writing this, the latest version available is V 2.3.0.

introduction to android studio
Different Android Studio Bundles

How to Configure a Project?

After completing the installation of the Studio, run the program, and you’ll get a screen similar to this.

Android Studio Project Configuration - introduction to android studioClick on ‘Start a new Android Studio project.’ You’ll move on to a screen that asks additional details of the project.

Application Details screen:

introduction to android studio

Give your application a name under ‘Application name:’

The company domain is not of importance right now. You can write any domain. If you don’t have one, use ‘example.com.’

The package name is automatically set using your domain name and application name.

We don’t need C++ support either. You need to check this option only when using the Android Native Development Kit (NDK). This would have allowed you to develop applications using c++.

Finally, set your Project Location where it’s easily accessible, and click Next to go to the next screen.

Target Android Devices screen:

introduction to android studio

Here, we are adjusting the settings of the devices our Android app will run on.

For each major update of the Android OS, the API level is incremented. Having a lower API level will target a higher number of devices. You can select any API level. For the remainder of this course, we will be using only Phone and Tablet apps. In that, we’ll use API 21: Android 5.0 (Lollipop).

Click Next to go to the next screen.

Selecting a preloaded Activity screen:

introduction to android studio

In this section of the project configuration, we choose an Activity to be preloaded.

An activity can be defined as a page on the Android app. Like how websites have different pages, Android apps have Activities. Each activity has two files, the XML (.xml) file to design how it looks and the Java (.java) file to write code in that activity. By selecting an empty activity, all other activities can be included. This is why all our projects will start with a blank activity.

Select the Empty Activity and proceed.

Customizing the selected Activity:

introduction to android studio

Here all we are doing is describing the activity we have selected. Android Studio will provide default values [Activity Name: MainActivity] and [Layout Name: activity_main].

You can let it be as it is. Make sure to check the two options [Generate Layout File and Backwards Compatibility (AppCompat)].

What’s in the Android Studio Interface?

When you click Finish, Android Studio will start building your app. It is normal for some systems to take more than a minute to finish all processes. Once all processes are completed, you’ll get the Android Studio Interface.

Android Studio Course - introduction to android studio
Overwhelming Interface!

Looking at the interface like this can be quite overwhelming. This is where most people turn back because there’s too much information on one screen. So, for now, I want you to focus on only the items we will be using. Here’s the screen I want you to focus on.

Android Studio Course - introduction to android studio
Focus only on the things that matter for now

On the palette, we have all the elements available to design our app. All buttons, text fields, textviews, imageviews, and many more things are available to choose from. For now, click on the run button, and that will take us to an AVD manager. Here, we have to set up our virtual device. If this is the first time you are developing apps with Android Studio, this is the screen you will get.

How to set up a Virtual Device in Android Studio?

introduction to android studio

A virtual device is some space in the memory that functions as a phone. We can have multiple virtual devices with different versions of Android OS running on it. This is helpful when testing your app for backward compatibility. Multiple devices can be used to debug instant messaging applications.

Click on ‘Create New Virtual Device,’ and Android Studio will give you a lot more options to configure your Virtual Device.

introduction to android studio

AVD name is simply the name given to your virtual device. You can just let it be what it is, or give it a name to remember your configuration.
You also have to select the device to run the app on. For this example, we are using the Nexus 6 running Android 7.1.1 (Nougat). Let the remaining options be set to default and click on finish.

Perfect, now you have a virtual device set up and can use it to run the app. You might have to install the API you selected if it’s not already installed. Once everything is set, Android Studio will take about a minute and then launch your virtual device. If it doesn’t already launch your App, hit the run button again, and this time the emulator will launch the app.

introduction to android studio

This is it! We have successfully run our first app. There was no coding involved in this, but don’t fret just yet because you’ll be developing apps in no time!

Where to go from here?

Use Intent in Android Studio to start a new activity

Simple Calculator in Android Studio with source code

Weight Conversion app using Math Operators in Android Studio

Android Studio – Which Layout to use?

How to add video in Android Studio?

Related courses for this will be up soon!

One thought on “Introduction to Android Studio and running your first program

  1. Android Studio is a great system by which you can make apps but if you say that you don’t know programming language then you might take a try on AppPresser which is not necessary to know the programming language.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.