We are designing an app that users use on a subscription basis. When the user pays for a particular period, a receipt is issued from our server valid for the duration. The app is designed to be used "offline", so it will only be connecting with the internet to get the receipt from the server.
When in "offline" mode, the app waits for the paid duration #-of days until it requires the user to pay again. We are having problems implementing this.
We first tried to use an always running background service. But after reading https://stackoverflow.com/a/2682130/5753416, http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-are-not/, we decided to use AlarmManger to schedule periodic alarms to check for the payment.
We are now facing problems with the alarm when the user changes the time/date. We are listening to Intent.ACTION_TIME_CHANGED and Intent.ACTION_DATE_CHANGED broadcast, but that isn't being broadcast when setting the date to the past.
My question is what is the right way of implementing a similar functionality. Any advice is appreciated.
edit