Chapter 1: Observable

android2ee (Seguy Mathias)
1 min readDec 2, 2020

In this chapter we create Observables in a simple way.
By the way the rule to observe them is:
observable.subscribe(observer);
But let’s first create an observable that we could later observe…

create()

Your just need to provide a lambda where the parameter is the emiter and call onNext or onComplete on it:

just()

Your just need to provide the element or the list of elements to emit:

fromItreable()

Your just need to provide the list of elements to emit:

More on the topic

Next chapter: Chapter 2 : Observers

This chapter is a small part of a biggest training project, you can find on Github. You’ll have the main branch with the answers/responses/unit tests and documentation. You could start with the “questions” branch to only have the questions.

You’ll have the full table of content of the articles on Medium.

You can download the book on Android2ee

Warning: Those articles has been created only because I am stuck in a Rx Android project and I need to prepare the ramp up for those who will replace me.

My conclusion : Choose Kotlin and suspending function instead of Rx. PLEASE, save your project from RxHell !!!

Write Medium in Markdown? Try Markdium!

--

--

android2ee (Seguy Mathias)

Android2ee alias Mathias Seguy. Android expert gives you some news on the Android world. mathias.seguy@android2ee.com