Question

I am Trying to understand RoboSpice Library in android


I saw the online Documentation here


What i tried::

  • I have previously studying on using Spring Library,also Retrofit, AsyncHttp etc
  • I understood that all above convert JSON response to POJO

What i need more information::

  • When i see the documentation on Robospice it looks like a wrapper around either of Spring or Retrofit or AsyncHttp etc
  • Is it true ?
  • So by using RoboSpice can we select the underlying layer to be Spring or Retrofit or AsyncHttp etc
  • So if that happens RoboSpice makes Spring or Retrofit or AsyncHttp etc as BoilerPlate code and makes development easier

If i am not correct, please provide a clear info w.r.t this


I am new to android, Please go easy on with answers

Était-ce utile?

La solution

I'm not an expert on RoboSpice but here is my quick explanation of its function:

Often in our app we would like to do Asynchronous network operations (get image from url etc.)

A common technique is to do the network request within an AsyncTask object.

The problem is that the AsyncTask object is not handled by the activity lifecycle.

When the device configuration change occurs (e.g. rotate device) a new activity is created (See Handling runtime changes). The original activity which created the Async network request is destroyed now but the AsyncTask is still working. The AsyncTask which is doing the networking will now maybe try and update the UI with some progress information (e.g. download has completed). But the AsyncTask still refers to the original activity which has been destroyed now. We need the AsyncTask to attach itself to the new activity.

My knowledge is that RoboSpice helps solve this problem. I cannot comment on the underlying implementation of RoboSpice.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top