Android MVI Simplified

No libraries needed, just MVI

Android MVI Simplified

Why am I here? When I first started jumping into MVI and learning about it, there were few if any sources that I remember being complete enough for me to implement the pattern on my own. I don't like that. I could understand the benefits of it, but couldn't picture how it would look in production without a basic understanding. I want to solve that problem for the next person, so let's build an MVI app with only the libraries available in a new Android Studio project. [Read More]

Why Kotlin? An Introduction. (Part 6)

Extensions

Why Kotlin? An Introduction. (Part 6)

This post is going to be a short but sweet one as I introduce the power of Kotlin extensions! Kotlin extensions allow you to simply extend the functionality of a given object. Say for some reason you're developing an Android app and find yourself passing around an instance of context a lot to get a simple desired result. As everyone (should) know, passing around an instance of context is dangerous. It can lead to memory leaks and makes your application more coupled, complicating testing. [Read More]

Why Kotlin? An Introduction. (Part 5)

Jumps

Why Kotlin? An Introduction. (Part 5)

It has been a little too long since my last post, but it's been a busy couple of months as I've been pushing hard to get some of my side projects moving along. Be on the lookout in the future as I plan to start going into more Android focused posts. If you're familiar with C your mind probably just jumped (pun intended) to a bad place. Don't worry though, Kotlin's implementation isn't anything as divisive as Dijkstra's or Rubin's arguments. [Read More]

Why Kotlin? An Introduction. (Part 4)

Back to the good: Control Flow

Why Kotlin? An Introduction. (Part 4)

We're going back to some of the good stuff right now. Control flow! Last week was a little more ranty, with a little less real content than I like, so I'm going to try to put a little more content in this week. ZZZzzzzz…. We'll get the boring stuff out of the way first… What's the same in Kotlin as in Java? Most of it… While and Do While still doing the same thing Kotlin: [Read More]

Why Kotlin? An Introduction. (Part 3)

Error Handling: Something went wrong...

Why Kotlin? An Introduction. (Part 3)

Lets follow up the discussion about nullability and talk about error handling in Kotlin. Syntactically, the differences from Java are pretty nominal, except for one pretty major key difference that I'll get to in just a second. First some code to demonstrate how similar Kotlin Exceptions are to Java's Exception handling: fun doSomething(data : String) { if(data.contains("test")) { throw IllegalStateException("Test!") } } fun main() { try { doSomething("testData") } catch (e : Exception) { // This will always get called because an exception is thrown if a String containing "test" is passed to doSomething(. [Read More]

Why Kotlin? An Introduction. (Part 2)

java.lang.NullPointerException at Main.subTitle(Main.java:847)

Why Kotlin? An Introduction. (Part 2)

In the first part of this series I stated I'd very likely start all my new Android projects in Kotlin. Don't get me wrong, I don't hate Java, but why would I make such a bold claim? The answer is null. Or more specifically, the explicit detraction of the use of null that Kotlin promotes. Kotlin has some nice features, but its handling of null variables is what hooked me. [Read More]

Why Kotlin? An Introduction. (Part 1)

Because it isn't just a fad anymore

Why Kotlin? An Introduction. (Part 1)

The Awakening When Kotlin was announced as a first class Android language at Google I/O in 2017, I like many Android developers, was skeptical. As an ardent user of Jetbrains products for a number of years now I haven't been oblivious to Kotlin, but I've only recently begun to take Kotlin seriously. In fact, after developing CoinWatch in Kotlin, I don't know that I'm going to start another Android project in Java (willingly) ever again. [Read More]