https://coroutinedispatcher.github.io/coroutinedispatcher/images/stavro.jpeg

The Android guy

Server side kotlin using Ktor. An authentication example.

Let’s be honest, I didn’t enjoy Ktor in the beginning. It seemed pretty confusing, different, immature, and difficult to start with. Watching it grow from away was a little simpler. However, I returned to ktor since I was interested more in server-side Kotlin. Kotlin is doing great, by the way, lots of improvements and new exciting features came up with 1.5.0 release, which makes it the perfect time to consider using it not only on Android but also server side, desktop etc.

Git me baby one more time

Long time no see. Nothing new on Android from my side this days. I have mostly been focused in learning some new tech stack and some automation. But today I would like to talk about some basic git commands/concepts and situations. Let’s immediately jump to some ancient debate: Rebase vs Merge For any reader who doesn’t know the difference, I am trying to illustrate it in the below diagram.

Stateful MVVM across process death using SharedFlow

onCreate Lately, I have been playing and exploring SharedFlow. A pretty nice and very helpful design for situations like this. But as I was building a ViewModel this week, I ran into an architecture design dilema. onPause Disclamer: The solution given below, might not be the best out there, so please feel free to give your thoughts and critics for this. onResume Let’s consider this quick example: class SomeViewModel @ViewModelInject constructor( private val dependency1: Dependency1, private val dependency2 : Dependency2, @Assisted private val savedStateHandle: SavedStateHandle ) : ViewModel() { private val _state : MutableSharedFlow<State> = MutableSharedFlow() val state : SharedFlow<State> = _state.

Usage of SharedFlow

onCreate With the 1.4 Update, kotlin coroutines brought us a lot of features and improvements. One of them was the introduction of SharedFlow. Basically, what I would like to call it, is simply a “Single Event StateFlow”. Remember single event LiveData workaround? Well, here you have it, but 100% kotlin, and not a workaround anymore. If you are more interested in an even more detailed explanation, follow this issue on Github, brought by Roman Elizarov.

First experience with Jetpack Compose

onCreate It’s been a couple of weeks since Jetpack Compose reached in alpha state. So, I thought I should start giving it a try. Getting started with it is not that hard. There are a lot of options, but I will render what worked for me: Joe Birch’s blog. Stack Overflow A quick read through the Google Codelabs Jetpack sample apps from Google’s repository (Mostly looking at JetNews) Note This posts code example is not a best practice example.

The Great Wall of China was originally created to keep WebView out. It failed miserably.

onCreate Let’s face it, getting a NaN in Android is more frustrating than a (Kotlin)NullPointerException. Well, as a Native Android developer, I actually never touched the web professionally, except playing around with Vue js when people seemed pretty hyped for it. I tried to be a web developer only once in my life, but even then, I cheated, I used KotlinJS. Anyways, many mobile developers have been in situations when they had to write a WebViewFragment and load an URL.