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!

Android and RxJava: Using a Single

  • Use RxJava's Single class when the expected type is either a success or error.
  • It's only slightly different from Observable.just(), which we discussed in the last article.

2 days ago

Android and RxJava: Getting Started

  • The powerful library RxJava can help developers build better apps.
  • See how to use Observables and Observers in this tutorial.

2 days ago

Android RecyclerView with Kotlin - Part 1

  • Oftentimes, developers need to display a list of some sort of data.
  • Whatever type of data is displayed, you should use a RecyclerView.

6 days ago