This video shows the usage of lifecycleservice using a stopwatch timer as an example. As the timer gets started, there will be a foreground service that shows a notification with a current timer. I have used a singleton pattern approach for service in order to observe live data values that are inside the service.
00:48 About base branch
01:20 Activity to Service communication
07:10 Create TimerEvent sealed class
07:54 Service to Activity communication
11:01 UI state…