Skip to main content

Command Palette

Search for a command to run...

Observable using create

Published
1 min read

create is an important method to create Observable. Below are few points which make Observable using create interesting

  • Creates from scratch
  • observer methods are programmatically written
  • emitter method is provided for interfaces to use
  • Below is the code which can help you to understand creating Observable using create method.

    Here we are trying to create Observable using create method where we get 15 different shapes. The create method provides a subscribe method where we are iterating each elements from list and emitting one by one. The emitted events are listened on DemoSubscriber.

    For RxUtil.java class and DemoSubscriber and for full code you can refer git library : https://github.com/CODINGSAINT/rxJava-tutorial

    Now once you run it you will get following output

    34 views

    More from this blog

    C

    Coding Saint - Simple Short Tutorials

    52 posts

    I am Kumar Pallav, a passionate programmer.I love java, open source & microservices . I create Simple , Short Tutorials Follow me at https://twitter.com/kumar_pallav