codepath / android_guides

Extensive Open-Source Guides for Android Developers
guides.codepath.com
MIT License
28.31k stars 6.35k forks source link

RxAndroid and Retrofit #183

Closed mayojava closed 8 years ago

mayojava commented 8 years ago

I just created a post on RxAndroid and Retrofit https://hackmd.io/BwEw7ALADAZghgYwLQQgkKEGYCMTjAJxICsJOAbGBTggEaw5A===

nesquena commented 8 years ago

@rogerhu can you take a look at this draft when you get a chance? Should we integrate this into the existing RxJava guide or better to add as a separate topic guide?

@mayojava your guides have been great so far, thanks so much for contributing

mayojava commented 8 years ago

Thanks @nesquena

mayojava commented 8 years ago

Any update on this @rogerhu @nesquena

rogerhu commented 8 years ago

I'll take it look this weekend -- there is obviously a lot overlap on the existing guide and I think we can fold some of the text explanations into it.

On Tue, Jun 14, 2016 at 3:22 AM, Adegeye Mayowa notifications@github.com wrote:

I just created a post on RxAndroid and Retrofit https://hackmd.io/BwEw7ALADAZghgYwLQQgkKEGYCMTjAJxICsJOAbGBTggEaw5A===

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/codepath/android_guides/issues/183, or mute the thread https://github.com/notifications/unsubscribe/AAT8ycG4jB5S15pw3G31YslYIuUFOJzoks5qLoDSgaJpZM4I1K-Z .

rogerhu commented 8 years ago

1) RxBinding -- I think the advantages need to explained besides the mechanics. What benefits does it confer? The best explanation I've seen is here: http://www.oreilly.com/programming/free/files/rxjava-for-android-app-development.pdf

2) Java 8 Lambda - what are the setup instructions? How does it weigh gainst using Retrolambda? I know there are advantages/disadvantages between the two?

3) I like the Rx basics and will fold it into what we have.

4) I've seen postings about cache() and replay(). They appear to be very two different things. When would one be used over the other?

mayojava commented 8 years ago

I will make the necessary update to the post @rogerhu . Thanks for the feedback

mayojava commented 8 years ago

Hi @rogerhu and @nesquena, I have updated the guide to include the changes you mentioned. You can check the updated guide here https://hackmd.io/BwEw7ALADAZghgYwLQQgkKEGYCMTjAJxICsJOAbGBTggEaw5A===

rogerhu commented 8 years ago

Thanks. Here's more feedback - some of the Retrolambda and config changes look great, will try to incorporate as well. Here's my progress so far:

  1. I looked through the intro for the existing guide and think it keeps the basic concept of Observables/Observers. I added the Observable.from() from your example and added a link to the RxJava guide about ways to create an Observable taken from your writeup (https://github.com/codepath/android_guides/wiki/RxJava#creating-asynchronous-streams).
  2. One thing to point out is that you list out the various ways to create an Observable, most notably Observable.from(), Observable.just(), and Observable.create() but it's not explained why the latter would need to be used. (It is especially to deal with async-based observables in which some long running happens or you have to wait for an event fire.)
  3. I added your schedulers example to the guide. Thanks.
  4. Here are some other items to think about too:

    https://github.com/codepath/android_guides/issues/178

  5. Also, RxLifecycle and Navi (https://github.com/trello/navi) are starting in my opinion to emerge as really good libs to manage lifecycle issues. Navi for example is starting to allow you declare reactively onActivityResult() and onPermissionResult() events. https://github.com/trello/navi/blob/master/sample/src/main/java/com/trello/navi/sample/MainActivity.java
rogerhu commented 8 years ago

Added separate Wiki on lambda expressions here: https://github.com/codepath/android_guides/wiki/Lambda-Expressions

mayojava commented 8 years ago

Great @rogerhu

rogerhu commented 8 years ago

Created this draft for the Rxbinding: https://github.com/codepath/android_guides/wiki/RxJava-and-RxBinding

rogerhu commented 8 years ago

Also incorporated the section on Observable.just() in (http://guides.codepath.com/android/RxJava#other-ways-to-create-observables) -- note that the recommended way is to wrap it in Observable.defer() especially with slow blocking functions.

mayojava commented 8 years ago

Thanks @rogerhu for the updates and changes you made. I appreciate that. Ive been a little busy and I still intend to make the corrections you pointed out on this main draft, so this issue can be closed.

rogerhu commented 8 years ago

I went through most of the doc to make sure to pull stuff in...just finished pulling in your changes on https://github.com/codepath/android_guides/wiki/RxJava#handling-configuration-changes.

I'm going to break apart the Retrofit stuff into a separate guide I think too.

nesquena commented 8 years ago

This is awesome, thanks so much for your contributions @mayojava and of course @rogerhu . This is shaping up to be the best rxJava Android guide on the web thanks to both of your efforts. What are the major missing sections now, if any?

mayojava commented 8 years ago

Thanks @nesquena and @rogerhu. I think we are almost there. Maybe just incorporating RxLifecycle into the RxAndroid guide.