Setting Up Android Tooling
Tags: android
Published: 2018-10-02 02:32:25

---
title: Setting Up Android Tooling
published: true
description: A walk through of downloading Android Studio and running your first project.
tags: Android
---

This post serves as a walk through for getting up and running with Android Studio. The purpose it should serve is to get started with your tooling and make sure you can run the default application. As a student, you can use this to make sure your tooling works correctly before jumping into development. As a mentor, you can send this to students to get setup prior to a workshop.

*Disclaimer:* The first iteration of this post was written on an Apple MacBook that already had the Android SDK installed. If you encounter any new steps, or find something specific to Windows, please let me know in the comments and I can update the post accordingly. As information comes in, I'll add it where it's relevant.

Let's dive in.

# Downloading Android Studio

You can download the latest version of Android Studio here: https://developer.android.com/studio/

Once you click the download button, the installer will appear in your downloads just like any other program. Once this is done, you can follow the setup wizard as you would for any other program - so I've opted not to write about that here. If you experience any issues with this step, please let me know in the comments!

### Linux Download

Pointed out in the comments, there's some additional steps after the install on Linux that you must follow.

1. Extract the archive that was downloaded in any way.
2. The resulting folder will be in `android-studio` if extracted via terminal, or `android-studio-ide-xxx` if extracted via a right click. 
3. Move that folder to a preferred location. This may be `/user/local` or `/opt`.
4. To install, enter the directy `/opt/android-studio/bin` (or wherever you moved it in step 3) and run `./studio.sh`. This will launch the setup screen from the next session.
5. When the setup wizard is done, go to `Configure > Create Desktop Entry` to be able to launch Android Studio like other apps instead of via the terminal.

You can find a video on the Linux install [here](https://developer.android.com/studio/videos/studio-install-linux.mp4).


# Setup Android Studio

The first time you open Android Studio, there are some steps you will need to follow.

First, we need to go through the Android Studio setup wizard.

![](https://thepracticaldev.s3.amazonaws.com/i/szqz5jzbmv2rnmbpudxp.png)

Next, we choose the install type. Let's keep it simple with the standard install.

![](https://thepracticaldev.s3.amazonaws.com/i/a8armloa8bkqn222ubl7.png)

Then, we get to choose a theme. I'm partial to Darcula and other dark editors, but this decision is completely up to you.

![](https://thepracticaldev.s3.amazonaws.com/i/d6lqznkocgwnyeg3f2uf.png)

Last, we get to verify all of our settings, and click finish.

![](https://thepracticaldev.s3.amazonaws.com/i/32fnz9dtw6lsqcy3agf6.png)

This will then take a moment to complete the setup, and you'll be greeted with the Android Studio landing page.

![](https://thepracticaldev.s3.amazonaws.com/i/g060q45gxqs44rl22fcz.png)

# Creating Your First Project

This section isn't going to walk you through how to build an app. It is, however, going to show you how to create a bare bones application that you can run on a device to make sure the tooling works. 

Once you've hit the landing page that we've seen above, we can click the button to create a new project. From there, we can name our project, give it a package name, and choose if we want any additional language support. The default is Java, but we could also chose to build an app in Kotlin.

![](https://thepracticaldev.s3.amazonaws.com/i/94zdp073o1193x2jclkq.png)

Next, we need to determine the minimum API version of our application. This defines the earliest version of Android that our application can run. The community can be very divided on this, but for the intents and purposes of testing our tooling you can pick whatever you want.

![](https://thepracticaldev.s3.amazonaws.com/i/ozu9hxkcnh7yaastenc1.png)

Now it's time to pick a template. This template will be used for the activity you create, and can fill in boilerplate for things like a navigation drawer, a login activity, or something else. Here, let's just select empty activity to keep it simple.

![](https://thepracticaldev.s3.amazonaws.com/i/hinly1heyz4yl7tio0c8.png)

Naming your activity can be relevant to your project. You should give it a name that reflects what it's doing. However, since this is solely about getting up and running, you can leave the defaults. 

![](https://thepracticaldev.s3.amazonaws.com/i/j0ag8nmjjd1bmzoocho3.png)

After clicking through that, Android Studio will do a gradle build in the background, and soon it will open up to your project.

![](https://thepracticaldev.s3.amazonaws.com/i/d93a4enwtzvyteove6jp.png)

# Emulator Setup

Having created a project, the next step is to be sure you can run it. This section shows how to do so with an Android phone emulator. For information on how to do it with a physical device, see the next section.

Let's start by opening up the AVD Manager (Android Virtual Device).

![](https://thepracticaldev.s3.amazonaws.com/i/qeiapuk73snwyvwi8y2t.png)

You'll be greeted with a landing page that explains you have no devices set up, and prompts you to add one.

![](https://thepracticaldev.s3.amazonaws.com/i/mym3taq3euplms5bzwhg.png)

In this menu, you'll select a type of phone to emulate.

![](https://thepracticaldev.s3.amazonaws.com/i/7q7ori8zthgrqmeizbnd.png)

Next, we need to pick an operating system for our phone to run on. You may need to download the appropriate SDK first.

![](https://thepracticaldev.s3.amazonaws.com/i/fael82utbcofkzvrzrdz.png)

You can customize the emulator's name and launch configurations, but let's move forward with the defaults.

![](https://thepracticaldev.s3.amazonaws.com/i/4sh3tu2t9emp2ewv9v9k.png)

Now we can see a list of our devices. We can use the little run icon to start our emulator.

![](https://thepracticaldev.s3.amazonaws.com/i/q16c18muiu38qr0xwyts.png)

![](https://thepracticaldev.s3.amazonaws.com/i/lik0ywxvr379cgd2629p.png)

Next, we can go back into Android Studio and find the run icon for the project.

![](https://thepracticaldev.s3.amazonaws.com/i/ak5ysxwzdyvzczuo4u1q.png)

Clicking this will bring up a list of connected devices. Selecting our emulator, we should then see the default application running.

![](https://thepracticaldev.s3.amazonaws.com/i/16bcuw0ptagv8wjn9w1g.png)

![](https://thepracticaldev.s3.amazonaws.com/i/txf88ivcnha0aznpm5wj.png)

Congrats! Now you're ready to start learning Android development, or follow along in your first workshop. As stated in the beginning, please let me know in the comments if you find any hiccups along the way. 

# Setting Up A Physical Device

In order to run an Android application on a physical device, you must first turn on USB debugging. If you've never done this before, follow these steps:

1. Go into settings.
2. Select "System".
3. Select "About Phone".
4. Scroll down to "Build Number".
5. Tap "Build Number" 7 times. 
6. Back out into "System" and you will see "Developer Options".
7. Select "Developer Options" and find the switch to turn on "USB Debugging."

Once you've done that, if you go back into running your application from Android Studio, you should see your physical device appear alongside the emulator:

![](https://thepracticaldev.s3.amazonaws.com/i/9jjzjaahyk33uokm0dlt.png)

Congrats! Now you're ready to start learning Android development, or follow along in your first workshop. As stated in the beginning, please let me know in the comments if you find any hiccups along the way.