I need to decouple a code from my app. The service seems to do pretty much the job I need, except 1 thing. My activity needs 1 worker thread (ListeningThread) that is running in infinite loop (listening, until the service is stopped) AND the app also calls custom methods, that should be executed just once (almost instantly).
So far my (vague) idea is to have a service that starts working thread + the custom methods might be called in a fashion of class instance ---> service.customMethod().
I came across iBinder, is this the (only) solution? Or is there any other way it can be done?