Creating the Messenger API service

It's time for us to create a service that performs the all-important job of communicating with the Messenger API we created in Chapter 4, Designing and Implementing the Messenger Backend with Spring Boot 2.0. We will be making use of Retrofit and Retrofit's RxJava adapter to create this service. Retrofit is a type-safe HTTP client for Android and Java built by Square Inc., and RxJava is an open source implementation of ReactiveX written in and for Java.

We added Retrofit to our Android project at the beginning of this chapter with the following line:

implementation "com.squareup.retrofit2:retrofit:2.3.0"

We also added Retrofit's RxJava adapter dependency to our module-level build.gradle script, as follows: ...

Get Kotlin Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.