“With great power comes great responsibility”
Uncle Ben, Spider-Man
Kotlin is great and expressive language. One feature that CAN greatly improve expressiveness and readability are operator overloading. Key thing here is CAN improve, you have to use it carefully and not go over the top. If you abuse it your code can be as unreadable as it can be. With that said let’s see what good implementation looks like.
Examples we will use to showcase this are:
1. Food ordering application. We will have
2. Simple state change.
Hello everyone. In this post I will show you how to make this cool effect BUT it’s not just for the effect itself, instead it’s for the thing you will learn while making it. We will learn couple of Jetpack Compose and Kotlin concepts.
Everything you need will be provided bellow and in gists.
In this article I will assume that you have basic Compose skills and you can set up Compose project by yourself.
First, let’s take a look at what our end result is:
What do we have here?
What do we want? We want to create Internet connection tracker that is backed by Kotlin
Flow . We want to display to the user that there is no internet connection, to retry our requests as soon as internet is available etc.
Our job here is to create
NetworkStatusTracker that will help us do what we talked about above, learn new things and have fun doing it.
For the start need class to represent network status. Let’s call it….
This is straightforward.
Now we are going for the main thing:
Let’s list our requirements:
Hello. Let’s talk about TESTING! Yeeey :D. More specifically how tests give you confidence and allow you to code faster with no fear of breaking things and introducing new bugs.
I will tell you short story with no happy ending :(.
Recently I have joined an Android project where group of developers developed app in record time. Code is bad and there are NO tests, not single one. App served the purpose but it has to be maintained and new features should be added. Everything is being done on the MainThread and the time came when that should be fixed, client…
Hello there. I hope this finds you in good health. I presume that you heard of Kotlin delegates. This post is not written to show you what delegates are, how to create them nor some basic usages. This post is solving specific issue and delegates are helping.
This post is library/framework agnostic. All implementations below are not to show how libraries/frameworks work nor how you should query database (for example). It’s simply to show the problem and the solution.
Short story. Imagine that you have joined the project and some files are not in great shape. One of those files…
Hello everyone and welcome to my FIRST POST! I will share short story of mine that will show what the problem is, how I solved it with RxJava, and why I used RxJava even tho I haven’t used it since Kotlin Coroutines appeared.
Before I begin I will say that if you are new to async (RxJava/Coroutines) thing and you are asking yourself should you go with RxJava or Kotlin Coroutines go with Kotlin Coroutines. RxJava has it’s good sides but it’s built for Java and not for Kotlin. Kotlin Coroutines allow you to write idiomatic Kotlin code. …