Spring Android Vs Retrofit
Asked Answered
E

0

9

I've been doing some digging lately into the REST Clients for Android. Majority of the discussions have been around Volley and Retrofit, seldom I came across comparisons between Ion, Robospice with these two. I could not find any comparison with Spring Android even though it seems to be a reliable Rest Client from a reputed open source framework.

Is Spring Android rarely used as a Rest Client? Does it not stack up well against the Rest Clients mentioned above?

P.S - Among the Libraries I mentioned above, looks like Robospice is solid when it comes to tying the request to the Activity lifecycle? I wonder if Ion, Volley, and other libraries do so?

Edomite answered 8/2, 2015 at 19:51 Comment(8)
Ion manages requests according to the android lifecycle as well. Cancels requests made by destroyed activities, etc.Mistranslate
So this means that even if one were to pause and activity or change the orientation of the activity the Ui would still be updated without memory leaks ?Edomite
@Mistranslate - What networking layer does Ion use ? Is there are merger for using it with Okhttp like the ones we have with Retrofit and RobospiceEdomite
It handles cancellations. Not pause/resume behavior. That'd be up to you. It uses AndroidAsync, which I'd say is comparable to Netty (NIO), but lighter weight for android. github.com/koush/AndroidAsyncMistranslate
@Koush - Thanks I checked it out looks like AndroidAsync does most of what okHttp does, btw pardon my ignorance, when you mentioned that I will have to handle the pause resume behavior for pause/resume, how exactly would I do that with Ion, could you just show me how it is done, or a link to a sample would do just fine, and I am going to compile your comments as an answer, so that it might help others in the futureEdomite
I guess I don't understand your pause/resume question. Are you trying to somehow reuse the web request call made before the orientation change, after the orientation change?Mistranslate
Yes sort of. This is the scenario : 1. Make a Server Request running in the backgroun thread. 2. The request updates. let's say a progress bar, 3. I change the orientation, the activity/fragment is re-initiated and then the Server Request in the bg thread is still running but the UI is no longer is updated, only when the bg thread completed fully does the UI reflect its changes, I hope I made myself clear ? Here is what I am talking about . play.google.com/store/apps/…Edomite
has anyone found, is there any nice explanation for Spring Android Vs Retrofit?Rajab

© 2022 - 2024 — McMap. All rights reserved.