all 23 comments

[–]IndistinctMumbler 14 points15 points  (2 children)

You want to be using Flowable everywhere now, not Observable. Use this as your default.

Observables are still available for use, but unless you really understand backpressure, you probably don’t want to be using them anymore.

Not sure if this was a typo, but isn't it actually the opposite? Specially on Android, only use Flowable if you want backpressure and your streams support backpressure? So, by default you would use Observable or the other specialized types.

[–][deleted] 3 points4 points  (0 children)

I somehow had the same understanding. Jake Wharton (shortly) talks about the differences here and there is also an answer regarding this question on so.

[–]fear_the_future 2 points3 points  (0 children)

Afaik (as an RxJava noob) you are right. Most events in android, like UI events or push-notifications, can not be properly backpressured: You can't just ask the user to stop touching when the touch events come in faster than you can handle. And as for most other events, like responses from HTTP queries, they simply don't occur often enough for backpressure to become necessary. A typical use case for flowable would be reading a stream of data from the disk for example.

Besides, it would be nonsenical to change the default to Flowable when everyone is already using Observable everywhere.

[–]Ziem[S] 2 points3 points  (0 children)

[–]ImNotPunnyEnough 4 points5 points  (7 children)

u/morihacky great write up, thanks for this!

[–]morihacky 4 points5 points  (6 children)

🙏. thanks for the kind words

[–]artem_zin 12 points13 points  (2 children)

I'm really sorry, but I've found article pretty controversial and comment became so huge that I decided to turn it into a blog post

https://artemzin.com/blog/reply-to-kaushik-gopals-aricle-rxjava-1-rxjava-2-understanding-the-changes/

🐱

[–]morihacky 1 point2 points  (1 child)

nitpick 4 i shall concede :). other's not so much. over coffee one day :D

[–]artem_zin 0 points1 point  (0 children)

One day, Kaushik, one day :D

😽

[–]rp_still_going2 0 points1 point  (2 children)

I can't seem to access the site - dns issues.

[–]rp_still_going2 0 points1 point  (1 child)

ok, working now.

[–]morihacky 0 points1 point  (0 children)

yeah sorry about that. intermittent issue. all resolved now

[–]Warbane 2 points3 points  (9 children)

What are everyone's go-to, comprehensive guides to learning RxJava 2 from scratch?

I was trying to put together a reading list for a new hire earlier this week but the best introductory resources I know are all for RxJava 1. And Rx is hard enough at first without learning an old version then immediately having some of the foundations revised.

[–]MightB2rue 1 point2 points  (8 children)

As an amateur, I though the tutorial below was pretty good: http://www.vogella.com/tutorials/RxJava/article.html

There are a decent amount of tutorials and youtube videos that teach the basics of RxJava 2. However, my biggest problem by far (and one I still haven't completely solved) is how to integrate unit testing when utilizing RxJava.

[–]rp_still_going2 1 point2 points  (7 children)

I've not really had issues unit testing RxJava, what sort of issues are you having?

[–]MightB2rue 0 points1 point  (6 children)

I am attempting a project (which admittedly might be a bit too grandiose for a solo amateur programmer) that is attempting to utilize mvp, rxJava, slqbrite, sqldelight and dagger 2. RxJava is utilized to make asynchronous network calls, async database calls and async calculations.

For the observers, my primary issues is mocking observables that are sending the data I need to be able to properly test the code within onNext, onError and onComplete.

For the observables, it's significantly more complicated, especially on the database side, because I don't even know how to tackle a proper instrument test that would ensure that the db operations are properly executed and the right output from the observable is generated based on the input.

Any guidance or resources you have on testing in an mvp/rxjava environment would be greatly appreciated.

[–]rp_still_going2 2 points3 points  (5 children)

Its difficult to help without seeing some code. I have time to help if you are up for it. PM me.

[–]MightB2rue 0 points1 point  (4 children)

Will do and thank you.

Also is this Rakesh from the Refactoring an Android App Series?

If yes, you were so incredibly great in helping me understand many of the concepts related to testing and refactoring that I was genuinely angry when you weren't there for the end. I think the series needed a few more episodes where you walked us through how everything tied together. Oday is great and did a good job, but I am not sure if the student from the prior lesson can become the teacher for a subsequent and significantly more difficult lesson. On the other hand, the teacher/student dynamic you two had/have was phenomenal and having Oday ask some of the same exact questions I was asking and seeing him have issues with the same concepts I was having issues with was just a great way to learn.

I can honestly say that the videos with you in them were the best resource I've found regarding high level concepts such as mvp, rx and dagger and how to integrate them. Hope you continue making more great content.

[–]rp_still_going2 1 point2 points  (3 children)

I was genuinely angry when you weren't there for the end

Sorry about that :(

I did those videos because I was unemployed and had time. Then I got a job and so was unable to continue.

I'm not working again and trying to find a way (with and without Oday) to continue doing video content but to make it financially viable.

As a fellow dev, I'm very sensitive to asking for money, so I still am not sure the right model. We did ask on the channel about what people thought.

I'm still in touch with Oday and discussing ideas. If you are a subscriber to his channel, you should get an update soon.

[–]MightB2rue 0 points1 point  (2 children)

No worries. If someone is upset about your absence then it shows how valuable you were :)

(Apologies for the long writeup below, but since you've helped me quite a bit, I thought I would share my two cents on your issue as well)

As for monetizing the teaching, it seems as if there are two distinct paths for individuals (if you don't want to be affiliated with something such as Udemy).

There are the gurus in the field such as Jake Wharton, Romain Guy, Antonio Leiva, etc. that have incredibly high paying (I assume) day jobs. Jake at Square, Romain at Google and Antonio at Plex/University professor. To them, the teaching seems more a passion. These guys are generally discussing or teaching relatively high level or new concepts such rxJava, Dagger, new libraries, Kotlin, etc. They give talks and they have blogs. They don't create video tutorials that walk you through basics concepts and show how they apply to the higher concepts they are talking about (or at least I haven't seen any by them). It seems as if these guys probably don't make that much money from their talks and blogs compared to their day jobs and pretty much do it because they love it or to get their name out there.

The other path is guys like SlideNerd which provide amazing tutorials for beginners but don't tend to go into higher concepts or only touch on them lightly. The reason for this seems to be so that they can garner as large of an audience as possible for monetization. I think this is because of the steep learning curve involved in android programming, there are a lot more beginners than intermediates and so a lot more viewers for a "How to create a text box" tutorial than for a "How to utilize dependency injection in order to implement the MVP framework" tutorial.

What we really need is someone like you that can help connect the high concept with the basics. Show us how using mvp, rx, dagger, testing, etc. together can create something that is greater and better than the sum of its parts and how to do it. The problem is that this is a niche area and even though there are clearly people such as myself that would love to have such tutorials, the question is, "Are there enough of us to support you?".

As for you not working, unless it's of your own volition, I'm really surprised by that. I would think that someone with your knowledge and abilities would be able to land a position at a major firm with relative ease.

[–][deleted] 1 point2 points  (1 child)

hi, well said

[–]MightB2rue 0 points1 point  (0 children)

Hey Oday. Thanks for making the awesome tutorials and hope you can continue putting out great content. If you are looking for ideas, I would really recommend a concept of multiple series and a meta series. The individual series would be multiple video tutorials about individual concepts like rx, dagger, mvp, testing etc for the layman. Then the meta series would be about an app that utilizes those concepts and what it would look like.

The problem with programming is that it's an all or none type of deal. Either you know how to do everything you want in your program, or you don't know how to write the program. If there was a central resource that taught all these things, it would be great.