Currently, I am using a remote service to act as a timer(just needed to increment time and seconds to show how long a user has been at the gym) and communicates with a fragment via a handler. I did this because I needed the timer to persist independent of the lifecycle of the fragment and its parent activity. For the most part, it works like a charm; however some of my friends are noting that the timer will occasionally stop, I do not have logs for this, but the only logical situation I could think of is that the remote service is getting killed.
I know that background services are eligible to be killed when the system deems necessary, so I was wondering if anybody could provide a suggested architecture change?
Thanks.
I decided to best route was to bring the service to the foreground, allowing the user to see how long they are checked in via notification, which is updated every second via the service.