Lessons.kt

Six files.

Each lesson is a short Kotlin file. The samples are teaching notes for this desk, written so a reader can see the type before the screen.

01Nulls.ktNull is a typeString and String? are different. The compiler asks before you call a method.02Functions.ktFunctions, values, and whenval is a binding. when is a branch. The return type is part of the sentence.03Screen.ktA screen is a function of stateThe UI reads state and sends events up. It does not fetch on its own.04Work.ktCoroutines stay off the main threadsuspend marks a function that can wait. Dispatchers decide where it waits.05Desk.ktState, events, and one directionThe screen sends events. The holder updates state. The UI renders it.06Bridge.ktCalling Java without pretendingKotlin compiles to bytecode the Java Android APIs already understand.
Danville · educational · 2018AboutDeskFAQOffice