May 2022
Intermediate to advanced
688 pages
20h 12m
English
In the project tool window, right-click the com.bignerdranch.android.geoquiz package and select New → Kotlin Class/File. Enter Question for the name. Double-click Class in the list of options (Figure 2.2).
Figure 2.2 Creating the Question class
Android Studio will create and open a file called Question.kt. In this file, add two properties and a constructor.
Listing 2.1 Adding to the Question class (Question.kt)
class Question {}import androidx.annotation.StringRes data class Question(@StringRes val textResId: Int, val answer: Boolean)
A common through-line of many software architecture ...
Read now
Unlock full access