Using RoboSpice for an asynchronous thread

I'm trying to use RoboSpice for my android app, but I'm very confused about the documentation.

Basically, I would like to implement only an asynchronous service in the background of the application, which will not be destroyed when the activity changes, etc. for the stream I'm running, similar to the infographic they showed here . How should I do it? I have a basic activity, so I added a SpiceService to the onStart () and onStop () functions as instructed, but I'm not sure what to use as my own SpiceService?

+3


source to share


1 answer


RoboSpice is designed to be tied to the Android activity lifecycle, so stopping SpiceService

between Activity

changes is fine. The component that stays constant between activities is its cache. You can try, however, keeping it SpiceService

active throughout the life of the application by linking it to the Application

context, but not recommended .



About the other part of your question (what is custom SpiceService

to use), you should probably check the standalone example .

+1


source







All Articles