Getting started with Android Studio

This article goes through the basic steps of installing, configuring and creating your first app with Android Studio on Windows. For other platforms and for a more thorough guide, go to the Android Studio install guide or this Javaworld guide. Android Studio needs lots of resources, so it is recommended to run on a high-end PC or laptop.

Download Android Studio from developer.android.com/studio.
Click the ‘download options’ link if your platform is not automatically detected.

Run the downloaded file.

Click Next a few times, then Install to start a default installation.

When finished, hit the Finish button. Android Studio will be started.

Setup Android Studio

The first time you start Android Studio, you can import settings, eg. from a previous install. If you have never used it before, leave the default option to “Do not import settings”. Click Ok.

Decide whether you want to share data with Google and make the appropriate choice:

The Android Studio Setup Wizard will be started. Click Next a few times for a standard installation. Choose a theme you like. Click Finish.

Some additional components will be downloaded and installed. Check the log for errors, then click Finish. (if errors occurred, check the troubleshooting info at the bottom of this article)

Android Studio will be started with the welcome dialog:

Choose “Start a new Android Studio project”
Choose “Basic Activity”, click Next.
Type a name: “Hello world” and select the Language “Java”.
Select API level 19:

Press Finish. Android Studio will be started:

It is advised to run Android Studio full screen. Reduce the height of the log-window at the bottom. Close the What’s New and Assistant screens. The content_main.xml should be open. If not open it via the Project structure, in folder app, res, layout.

Increase the zoom so you can view the userinterface layout better:

Configure an emulator

We are going to use an emulator to test your app. An emulator ’emulates’ a device (a phone) on your computer. More info.

From the menu, choose Tools > AVD Manager. Click “Create Virtual Device”. Choose the device you prefer; in this example we use the Pixel 3:

Click Next. Click one of the download links to download a system image. It is recommended to take the top one (Q, Android 10):

Accept the License Agreement and click Next. Wait for the download and install. In the next screen, enter a name for the AVD and click Finish.

Click Next, then Finish. The Android Virtual Device Manager should now list your device:

Close the Android Virtual Device Manager.

Run your app

From the toolbar, click the Run icon:

This will build your project, start the emulator and run your app in the emulator:

When the app runs, try interacting with it, click the menu icon and the mail-icon. They do not work, but some interaction should be possible:

Run on your phone

It is also possible to test the app by running it on your phone. More info.

First, check the android version of your phone. It should match the target version used by the project in Android Studio.
On your phone, enable Developer Options and turn on USB debugging.
Connect your phone (with an USB cable). Select the option to “transfer files”.
Your phone should appear in the list of devices:

Now press Run and wait for the app to be installed and started on your phone.

Next tutorial: write your first app

Continue to the next article: “Android Studio: create a first interactive userinterface” or go to the list of articles on Android App Development.

Learn more

Troubleshooting

Errors during install/first start: [coming soon]

More help: