September 2018
Intermediate to advanced
386 pages
11h 17m
English
Reactive programming has already become very popular among developers. In most android apps, RxJava/Android is used in obvious ways. API calls are one of those use cases. We have attempted to make an API call using RxJava. With Kotlin, you will hardly see any verbosity and the code is so readable.
You might be wondering how the magic is happening here. Lambda functions are the answer. All those curly brackets you see here are lambda functions. I have highlighted them in bold:
override fun getPolls() { RetrofitAPIClient.getClient().create(PollService::class.java) .getPolls() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .doOnSubscribe { view.showLoader() } .doFinally { view.hideLoader() } .subscribe( ...
Read now
Unlock full access