Exploring the project's Kotlin code and the main layout's XML code
We are going to look at the resource files containing the code that defines our simple UI layout and the file that has our Kotlin code. At this stage, we won't try to understand it all, as we need to learn some more basics before it makes sense to do so. What we will see, however, is the basic content and structure of both files, so we can reconcile their content with what we already know about Android resources and Kotlin.
Examining the MainActivity.kt file
Let's take a look at the Kotlin code first. You can see this code by left-clicking on the MainActivity.kt
tab, as shown in the following screenshot:
As we are not looking at the intricate details of the code, an annotated screenshot is more useful than reproducing the actual code in text form. Regularly refer to the following screenshot while reading this section:
The first thing to note is that I have added a few empty lines in among the code to space...