The Android guy

A comparison between Flutter's Injectable and Dagger 2 in the JVM world

I have been playing around with Flutter lately. More specifically I discovered Injectable; a dependency injection tool for Flutter, also built by google, but extremely similar to Dagger 2. Since I also feel very comfortable in Dagger 2, I would like to make some comparisons between them. Differences Generated code The biggest difference they have is that Flutter Injectable it’s a combination of two libraries: GetIt and injectable where injectablemakes sure to generate the code and GetItis the one that is used internally by the compiler to construct the service locator; while in Dagger 2, dependencies are generated manually.

Getting started with Jetbrains Exposed, a Kotlin ORM framework

Even though my main focus is still Android, from time to time I try to play around with other stuff from the Kotlin world. Lately, I have been exploring KorGE (it’s a game engine for Kotlin) and KTOR. But today’s article is about KTOR, and more specifically, about the database layer. Kotlin and what is being built on top of it, is moving so fast, and I want to catch ‘em all.

Using git from Android Studio. A quick guide.

We all know how important version control is. One can save a lot of time in case conflicts occur or things go really bad. But we can still argue which tool is the best for using Git. That’s because Git in general is abstract, and visualizing it is somehow hard, as this also needs to go along with everyone’s head. I would not blame anyone if they fantasize git differently in their heads, and then argue about the tool.

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.