Where should I use var and where val?
In Kotlin, you should use var where the value of the variable is changing very frequently. A good example would be getting the location of an android device:
var integerVariable : Int? = null
Whereas, Val should be used in a case where there would be no change of value throughout the whole class. For example, setting the value of text view or maybe a button’s text through code:
val stringVariables : String = "Button's Final Text"