There is no doubt that people are getting away from GSON and I agree with those reasons too. The only advantage GSON has over other parsing libraries is that it takes a really short amount of time to set up. Furthermore, the most important thing is that Moshi is embracing Kotlin support. First let’s implement the dependency: implementation("com.squareup.moshi:moshi:1.8.0") It’s not a struggle to migrate to Moshi. It’s really Gson look-a-like.
The coroutines API has already brought some innovation in the Android and Kotlin world. I always loved the idea of keeping it as simple as we all can. There is a saying around here that “Whoever talks to much, makes too much mistakes” and I see this a little bit related to Java’s verbosity and also in the world of concurrency. It’s said over and over again that concurrency is not simple and I couldn’t agree more: You have to care about context, jobs running in parallel, cancelation, returning values etc.
My last article covered some simple example about Room and RxJava instrumentation testing code. Coroutines also have great support in unit testing even though todays topic has nothing to do with it. What I mean is that we are not going to cover runBlockingTest this time. Android doesn’t support that (correct me if I’m wrong please) yet. However, I could schedule a topic about that because it really makes me excited.
When it comes to testing the data layer, we should always have time for that. It’s very important. You lose data, you lose users. Since I really found testing + Room pretty amusing, I thought I should share it with you. Room has already a great support for RxJava or Coroutines. I have used both ways to access the data layer and I was really satisfied with both. So I decided to make a 2-series blog posts with testing in Room with RxJava and testing Room with coroutines.
When it comes to solving the Dependency Inversion principle, there is no better way then using annotations in the JVM world. However, generating code in compile time has some costs. For example the build time. And I believe this is the only thing dagger can’t do well alone. This is not a bye bye dagger post. This is mostly, obtaining the most out of Dagger. To solve this problem, Dagger-Reflect was written.
Once getting inside the open source concept, the idea and desire to publish a library is inevitable. What you need is an idea, or perhaps make a better version of an existing library, or just you need to use some module inside your company for several projects. With the JitPack, you won’t be suffering at all. So how do you do it? For the sake of this tutorial, I’m just gonna make a logging library.