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!

Daniel Malone 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.

3 years ago

findViewById() in Kotlin

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

3 years 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.

3 years ago

Android SharedPreferences Tutorial in Kotlin

  • Use SharedPreferences to store simple data in Android Studio projects.
  • It's good for storing small amounts of data

    3 years ago

Cleaner Architecture for Android Apps

  • Clean Architecture for Android can help developers prepare for change.
  • But app developers can't possibly know what will change.

    3 years ago

Android RecyclerView with Kotlin – Part 3

  • In part three of this series, finish creating the RecyclerView.
  • Use onBindViewHolder to display data.

3 years ago

Android RecyclerView with Kotlin – Part 2

  • Create the entire RecylerView for our UsersAdapter.
  • Continued from part 1, where we set up the Android Studio project.

3 years ago

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.

3 years 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.

3 years 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.

3 years ago

Display Sample Data when Creating a RecyclerView

  • Android Studio's default RecyclerView preview lacks sample data.
  • Adding sample data can be helpful for debugging.

3 years ago