-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Mojtaba Razaghi edited this page Sep 30, 2019
·
3 revisions
This is a library written in Kotlin, for simplifying the API calls in android.
The retrofit helper will make a synchronous call, just using multiple lines of code.
It's as easy as this :
retrofitClient.Get<GetResponseModel>()
.setPath("api/users/2"))
.setResponseHandler(GetResponseModel::class.java,
object : ResponseHandler<GetResponseModel>() {
override fun onSuccess(response: Response<GetResponseModel>) {
super.onSuccess(response)
//Handle Response
}
}).run(this)
Using the benefits of RxAndroid, the API calls will occur in IO thread and the response will get to you in UI thread.