


In summary, Moshi knows about Okio and its API, so it takes advantages of Okio buffers and read and write content directly into this buffer without requiring it to allocate extra memory for this process (to convert the response data stream into Java code and viceversa). Here you have a great video from Jake Warthon explaining about Moshi and why Moshi works better than others with Retrofit.

We need to add the Retrofit dependency: compile "2:retrofit:2.0.0"Īlso we need to indicate to Retrofit which converter it should use to convert a JSON response into a Java (Kotlin) class and I’m going to use Moshi as it has better performance than Gson: compile "2:converter-moshi:2.0.0" We are going to use it to consume the Reddit API. Retrofit is an incredible easy to use library that turns your HTTP API into a Java (Kotlin) interface. Is a type-safe HTTP client for Android and Java
