Getting Started with Android Studio: Setting Up and Running Your First App

Abdellah Ibn El Azraq
8 min readDec 2, 2024

--

Contents

  • Introduction
  • Setting Up The Development Environment
  • Android Studio’s Features
  • Launching an Android App

Introduction

Welcome to the Mastering Android Development course! Before diving into app development, it’s essential to set up our work environment properly. A Software developer must be adept at managing their tools to maximize productivity. We’ll use Android Studio, a powerful Integrated Development Environment (IDE) for Android development. Despite its reputation for being resource-intensive, Android Studio offers many features that we’ll explore throughout this course.

Setting Up The Development Environment

The first step is to download and install Android Studio on your machine from the official website. While the installation process is straightforward, if you encounter any challenges or feel unsure about the steps, the official guide provides a detailed walkthrough.

Thankfully, installing Android Studio covers most of the setup since it includes all the essential tools. Among these, two critical components are the JDK and the SDK. But what exactly are they? Let’s break it down:

  • JDK (Java Development Kit):
    The JDK is a toolkit used to develop and compile Java and Kotlin applications. It provides various tools, such as the Java compiler (javac), a runtime environment, and libraries. A key distinction to note is the difference between the JDK and the JRE (Java Runtime Environment): the JDK is for development, while the JRE is for running Java programs.
  • SDK (Software Development Kit):
    The SDK is tailored for Android development. It contains tools, libraries, and packages that enable the creation and compilation of Android applications. These include the Android Emulator, debugging tools, and platform-specific libraries that streamline the development process.

For now, that’s all you need. Android Studio will handle the compilation and building of your applications, so there’s no need to configure any environment variables at this stage. However, if you encounter issues, you may need to set them up manually.

Android Studio’s Features

After successfully installing Android Studio on your machine and launching the IDE, you’ll see a screen similar to this:

Note: Android Studio updates its UI frequently, so the interface might look slightly different. Additionally, my IDE uses a custom theme, which is why it may not match yours exactly.

Android Studio Start Screen

This screen doesn’t display much — just options to create a new project, open an existing one, or import a project. Let’s create a project to explore the IDE. Click on New Project to get started.

The next screen presents several options. On the left, you’ll choose the type of device you want to develop applications for, while the rest of the screen displays various activity templates. For now, don’t worry about all the options — simply select Phone and Tablet from the Templates pane and choose Empty Activity, as shown in the image below, then click Next:

New Project Screen

Next, you’ll configure your project. This screen includes several settings you can adjust, as illustrated below:

Project Configurations

Here’s what each setting means:

  • Name: This is the name of your project. It will appear in the IDE and can also be used as the app name when installed on a device.
  • Package Name: The package name uniquely identifies your app on the Play Store and within the Android system. It’s typically structured like a reverse domain name, e.g., com.example.myapp.
  • Save Location: This is the directory on your machine where the project files will be stored.
  • Minimum SDK: This specifies the lowest Android version your app will support. Choosing a lower version ensures compatibility with more devices but may limit access to newer features.
  • Build Configuration Language: This determines how the project’s build system is defined. You can choose between Groovy-based Gradle scripts (the traditional approach) or Kotlin DSL (which offers better integration with Kotlin and type-safe build configurations).

Don’t worry about fully understanding the last two settings. We’ll dive deeper into them later in the course. For now, simply select any SDK version and choose Groovy DSL for the Build Configuration Language. You can name your application anything you like, and for the package name, pick any domain name that suits you. Once that’s done, click Finish. The IDE will start building your project — just wait for it to complete.

If this is your first time seeing the main screen of Android Studio after the project is built, it might feel a bit overwhelming. But don’t worry! It only takes a few minutes of exploration to start getting comfortable. Let’s take a closer look at what this screen offers:

Android Studio Main Screen
  1. Toolbar:
    This section provides many options, with the most commonly used ones being to run your app or launch Android tools. On the far left, there’s a hamburger menu icon — clicking it opens up menus like File, Edit, View, Tools, and Help.
  2. Editor Window:
    This is where you’ll spend most of your time. It’s the workspace where you’ll edit your app’s code, UI, and dependencies. Essentially, it’s the heart of your development process.
  3. Tool Windows:
    This panel allows you to manage your project files. You can customize how the project is displayed by changing the view in the dropdown menu at the top right. For development, choose the Android view — it provides a neatly organized structure that highlights the most important folders and files for Android development.
  4. Tool Window Bar:
    This bar makes accessing Android tools quick and easy. Tools like the Debugger, Logcat, Terminal, and Device Manager are all available here. Over time, we’ll explore these tools in depth. To pin tools to this bar, go to View on the Toolbar menu, select Tool Windows, and then choose the tools you’d like to display.
Tool Window Bar Tools

As you can see, Android Studio is packed with a wide range of features. Exploring them all in detail would require an entire course of its own! Thankfully, there’s no need to do that. As we progress through this course, we’ll uncover and learn about these features as they become relevant to our development journey.

Launching an Android App

To ensure everything is working properly, let’s launch the app without modifying anything in the code. But before we do that, we need a device to run the app on! Fortunately, we don’t need a physical device — we can create a virtual device using Android Studio. This will also introduce us to our first Android Studio feature. Here’s how to create a virtual device:

  1. Open Device Manager:
    You can open the Device Manager in two ways:
  • From the Tool Window Bar, click on Device Manager:
Device Manager from the Toolbar Window bar
  • Or, from the Toolbar main menu, go to View > Tool Windows > Device Manager:
Device Manager from the main menu

Once opened, the Device Manager panel will appear:

Device Manager Panel

2. Create a New Device:
In the Device Manager panel, you’ll see a list of virtual devices you’ve created. If this is your first time using Android Studio, the list will be empty. To create a new device, click the + icon and select Create New Device:

Create New Device

3. Select Hardware:
The Select Hardware screen will appear, displaying a list of devices with different hardware configurations. Some devices include the Play Store, but most do not. Choose any device you prefer, but it’s best to avoid foldable devices for now, as they may require more advanced handling.

Select Hardware Screen

4. Select System Image:
Next, choose a system image for the virtual device. You’ll need to download the selected image first. Once downloaded, select it and click Next:

System Image Screen

5. Configure Device Settings:
Finally, the Verify Configuration screen will appear. Here, you can customize properties like the device name, orientation, and more. Once you’re done, click Finish. Your virtual device is now ready!

Device Properties

Now, let’s launch the app by following these simple steps:

  • Select the Virtual Device:
    In the Available Devices menu located on the top toolbar, select the virtual device you created earlier:
Choose the virtual Device
  • Run the App:
    Click on the Run icon to start the app:
Run the App
  • Wait for the App to Launch:
    The virtual device will boot up, and the app will start running. Once it’s launched, the screen should display a white background with the text “Hello Android”:
App starts successfully

You can also run the application on a physical device. To do this, ensure that USB Debugging is enabled in your device’s developer settings. Then, connect your device to your computer using a USB cable. Once connected, Android Studio will recognize the device. You can then select it from the Available Devices menu and run the app.

That’s all for today! Feel free to explore the IDE and familiarize yourself with its features. In the next article, we’ll dive into actual development. For now, you’ve successfully set up your work environment — great job!

Social Accounts LinkedIn or X.

Resources:

--

--

Abdellah Ibn El Azraq
Abdellah Ibn El Azraq

Written by Abdellah Ibn El Azraq

I'm a software developer with a passion for coding, learning new technologies and share what I know with the world

No responses yet