In November 2017, I had the chance (and luck!) of participating in a great event at Latvia: Devfest Baltics.
It was awesome in many ways, but specially because of how the organizers treated us the speakers. I had never felt so warm (in such a cold country 😂)
I even had the chance to do a book signing!
The event was recorded, and talks are already available. You can watch mine here:
This talk consisted on a three-act session, where I talked about how Kotlin can help in several aspects of Android development. At the end I also talked a little about Kotlin multi-platform projects.
Kotlin to substitute Java
Kotlin is an awesome language to develop Android Apps, and has been official for some months. Nowadays there are barely any rough edges, so writing Kotlin and interacting with the framework is just wonderful.
Kotlin to substitute XMLs (with Anko)
Though this feature has people for and against it, it’s true that Anko provides a powerful way to write views without requiring the use of XMLs.
It has some good benefits that I comment on the talk. Also, you may remember that I wrote about it a couple of months ago. There you have more info about this topic if you want to learn about it.
Kotlin for Gradle
That’s another great announcement we had last year: Gradle would support Kotlin as an alternative to Groovy to write configuration files.
There’s been much improvement since first time I tried it (and it could be that now it’s even better, things move fast…), but there were still some annoying steps when I tried it to prepare this talk.
I also wrote a detailed article about this, that you can find here. There (and in the talk), I show you the steps I took to convert my Gradle files from Groovy to Kotlin. You also have an example in my Bandhook repository, where you can see it live.
With Kotlin multi-platform projects, we’ll be able in the future to share code very easily among many platforms. An example could be:
- Kotlin JVM for server and Android App
- Kotlin JS for Web
- Kotlin Native for iOS
Many of these features are still experimental or even alpha, but the future of Kotlin is bright and shiny.
Here you can see the slides of the talk:
How are you using Kotlin?
There are many ways to use Kotlin nowadays, and I’m sure you have some experience to share. Feel free to use the comments to tell me about it!
Author: Antonio Leiva
I’m in love with Kotlin. I’ve been learning about it for a couple of years, applying it to Android and digesting all this knowledge so that you can learn it with no effort.