I am trying to use RoboSpice for my Android app but I am getting very confused with the documentation.
Basically, I would like to implement only an asynchronous service in the background of the app which does not get destroyed when the activity is changed etc for a thread that I run, much like the infographic that they have shown here. How would I do this? I have a base activity so I have added the SpiceService to the onStart() and onStop() functions as instructed but I am unsure what to use as the custom SpiceService itself?
RoboSpice is designed to be tied to Android's activity lifecycle, so stopping the
SpiceService
betweenActivity
changes is normal. The component that remains persistent between activities is its cache. You can try, however, holding aSpiceService
active throughout your app lifecycle by tying it to yourApplication
context, but that is not recommended.About the other part of your question (what custom
SpiceService
to use), you should probably check the offline example.