Hello Android Studio!

Android Studio is where all Android development happens. It contains everything you need to develop, run, test and deploy Android apps. If you have worked with IntelliJ before, you’ll probably want to know that Android Studio actually is a fork of IntelliJ IDEA – so almost all keyboard shortcuts and menus are the same. If you’re new to IntelliJ and Studio, you need to learn two shortcuts right now:

  • Ctrl + Shift + A: search for anything in any menu.
  • Alt + Enter: Show suggestions to fix or improve whatever code you have highlighted.

If you haven’t done so already, install Android Studio from d.android.com/studio. The installer asks some questions – if you’re not sure what to answer, just stick to the default options. Eventually, you’ll reach the screen titled “Welcome to Android Studio”.

Optional: From the welcome screen, go to Configure ➡ Settings ➡ Editor ➡ General ➡ Auto import. Then, turn on “Add unambiguous imports on the fly” and “Optimize imports on the fly”. Now you can focus on writing code, and don’t worry about importing things.

To get started:

  1. “Start a new Android Studio project”.
  2. Let’s call our app “Deadline”, and use “hackerspace-ntnu.no” for Company Domain.
  3. Decide if you want to use Kotlin or Java. To use Kotlin, check the box labeled “Include Kotlin support”.
  4. On the next page, ensure that only “Phone and Tablet” is checked, and choose the oldest version of Android you want to support. For our project, the default is just fine.
  5. Then pick an “Empty activity”.
  6. Stick to the defaults on the “Configure Activity” page.

Eventually, your new app project will open in Studio. Click the green Play button near the top to run your app. If you have a real Android phone with you, turn on developer mode and USB debugging. Otherwise, click “Create a virtual device” and follow the instructions.

Congratulations, you now have your brand new app on your phone!

Next: The anatomy of an Android project