Cookie Consent by Free Privacy Policy Generator

[n]

Kotlin for Android and YouTube

week fifteen reflections

thoughts public-journaling

This week I have been working with Kotlin and Android. I am actively preparing my first YouTube video. It will be a remake of my final year bachelor project. I finished reading the "YouTube Formula" by Derral Eves. Although there is a lot of marketing, the book provides solid recommendations on the beginner steps.

Kotlin truly feels cool. REPL provides a fantastic feedback loop to try out things, fail and understand why faster. The installation process is easy. Even the package management felt thought through. There is a complexity that authors are bringing, like the focus on the functional way of writing things. Have a look at the following function:


fun apply(number: Int, operation: (Int) -> Int): Int {
return operation(number)
}

var number = 50
number = apply(number) { n -> n*2 }
println(number) // prints 100

As you see, the syntax for the last parameter operation is very special. It is not included in the parenthesis.

It is critical to understand this language as Kotlin is now the recommended language for Android. The change is also interesting in the app development, though - where I made a little progress. The UI can and should be defined within the Kotlin code, not XML. The so-called Jetpack Compose is the new way to do things. I will post more about it next time.

You can check the result yourself here. You can learn it yourself with the Google course Kotlin Bootcamp for Programmers

Send
Share
Send
Share