Android Studio Tutorial with Kotlin (2018 Edition) – Part 2

In the previous blog post, we setup Android Studio and also setup an Android app project. Today, let’s continue where we left off by getting familiar with the interface of Android Studio.

Android Studio is highly customizable, but the default mode is best, at least for now. After following the steps in part 1, your screen should look like this:

Android Studio, after creating a new project

Click on the image to view the screenshot in more detail. If your screen looks different, try selecting “Android” from the drop-down arrow on the left, then opening “app.”

As you may have noticed, Android Studio provides us with tabs (see the red arrow). You can easily switch between different files using the tabs near the top of the screen. Currently, content_main.xml is open. Pressing the “x” near the name of the file will close that particular file. To open it back up again, you can select “app” from the left of the screen (see red circle). After double-clicking app, double-click res, then layout, then double-click content_main.xml.

Android Studio: opening content_main.xml.

Next, let’s add some text to our app. We want the app to say, “Welcome!” To do this, let’s focus on the Palette panel, highlighted below.

The TextView widget

Next, let’s click-and-drag from TextView to our main screen.

Click-and-drag from TextView to anywhere on the main screen.

Your screen should now look like this:

Our default TextView widget

Great! Now let’s see how we can view our app on a physical device like a phone or tablet, or an emulator. We’ll continue in the next blog post!

About the author

Daniel Malone
Bringing more than a decade of software engineering experience, Daniel Malone is Editor at androidEveryday. An Austin native, Daniel is often found reading technical books, blogging and creating YouTube tutorials. When not working, he likes to listen to pop hits on Google Play Music.

Android RecyclerView Tutorial (Part 1)

  • Most apps contain lists of data using RecyclerView.
  • In this tutorial, use ConstraintLayout and Kotlin to display a list of data.

1 year ago

findViewById() in Kotlin

  • As you may have discovered, findViewByid() is no longer needed.
  • Kotlin adds the ability to directly access Views.

1 year ago

Android Architecture Components Tutorial: ViewModel + LiveData

  • Use Kotlin to build a basic Android app using Android Architecture Components.
  • As part of Jetpack, LiveData and ViewModel support a MVVM app architecture.

1 year ago