Over a million developers have joined DZone.

7 Tips for Using RxJava on Android

· Java Zone

Bitbucket is for the code that takes us to Mars, decodes the human genome, or drives your next car. What will your code do? Get started with Bitbucket today, it's free.

It's pretty clear that some people are very fond of RxJava, but that's not to say there are no hurdles to overcome. This recent post from at the Futurice blog explores Tuominen's first foray into RxJava, and while his opinion is clearly favorable, he suggests that there was a fairly substantial learning curve. Referring to the initial project, which he worked on last year, Tuominen says:

We made the bold decision to build the entire Android architecture in RxJava. Little did we know at that time, though, just how deep the dive would be. After a few initial encouraging experiments we were surrounded by eerie problems and sleepless nights.

In turn, Tuominen has come up with seven tips for using RxJava on Android. The tips cover a lot of ground, covering the following topics:

  1. Synchronous RxJava
  2. Hot and cold subscriptions
  3. Using subjects
  4. Monitoring your thread
  5. Studying RxJava
  6. Observer vs. action
  7. Memory leaks in subscriptions

Ultimately, though, Tuominen is happy with RxJava. It's just a matter of getting started. According to Tuominen:

...there was no desire to turn back. It was clear the reactive way was the right way and anything else would have felt but an ugly compromise. That is, in fact, the funny thing about reactive — no matter how hard it is in the beginning, it always feels it is worth it.

Check out the full article to learn what you need to know to use RxJava on Android.


Bitbucket is the Git solution for professional teams who code with a purpose, not just as a hobby. Get started today, it's free.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}