I have two background services in my application that are scheduled at regular intervals by the AlarmManager. The intervals are different for each service. I would like to run one service every two minutes, and the other service every 15 mins.
How can I prevent them from running at the same time?
If one Service is called while the other is running, I want it to run immediately after the first one finishes.
You combine them into one service, running every N minutes, that does the less-frequent work every Mth time.