Daily dispatch #10 - Ktor is a Delight

I recently started changing the project’s API client from Retrofit to Ktor.

And it’s been a delight. As a reference here’s the before and after code.

And I’d have to create those Single responses from RxJava2. Then there was the @GET annotations that made it a mess to put query parameters. Ugly as hell.

Then enters Ktor:

It just looks delightful, it’s clean, it has it’s own Domain Specific Language, so very little Annotations required.

Why I love Ktor

Let’s go over why I love Ktor more than retrofit.

First of all Ktor is multiplatform.

Second, it uses Kotlin Coroutines instead of rxjava2.

So we get to develop a KMM module for our app straight out of the box.

Json to Data Class Plugin

Another useful thing I’ve found is the Json plug-in for Android Studio.

You give it a json response from an api and it generates kotlin data classes for ya.

Check out what it generated for me from this JSON:

The generated Data Classes:

Pretty Cool hm?

Manga Web Portal

On a more entrepreneurial note. I’ve been thinking about a simple app to buy and sell Manga with verified users and sellers.

Could be called Golduru.

I think I could set up a website on firebase and backend on it as well.

Maybe eventually link account with a block chain wallet to help verify scammers as well.

I think there is enough demand in this market to be able to sell this service as an yearly subscription.