· 3 min read
Yo Dawg! I heard you like Kotlin (Talk at Devfest Baltics)
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:
Yo Dawg! I heard you like Kotlin
[embed]https://www.youtube.com/watch?v=W1kA-rYCf5Y\[/embed\]
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
This is basically what I’ve been talking all about in this blog, my book and the online course.
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.
Kotlin Everywheeeear!
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.
The slides
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!