Question

Situation: We have more than 5 android applications which are modular (and really limited in terms of functionality) and each has it's own IntentService in which it gets data from internet and stores it locally.

Also one app is core/main app. Now I want, that each app updates its data during the night. I don't want to put code for alarm, receiver and other stuff into every app. I want that core app sets Alarm, and when alarm goes off, then core app calls all IntentServices of every app.

Question: How can I prevent that system goes to sleep during the execution of services? One solution is that I use @CommonsWare implementation of WakefulServices in every every app instead of IntentService, but I don't really want to change code in all the apps. Is there any elegant way to solve this?

Was it helpful?

Solution

Thanks @CommonsWare your thoughts were really helpful.

So to conclude, solution is that every app implements WakefulIntentServices and then core app starts WakefulIntentServices of all the apps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top