This project contains different use cases of Background Tasks
with the implementation.
You will find different implementation on different branches.
br_with_wk
: In this, we have implemented the execution of a background task usingWorkManager
andAlarmManager
. TheCoroutine Worker
ofWorkManager
is used to execute the background task, once all the constraints are satisfied.
We are also showing a notification with a button to re-execute the task using aAlarmManager
, once thework
is executed.
Also, we are observing the table's data to reflect the changes on UI in case of any change.
Following are the tasks which gets executed in theWorkManager
:
- Network call: To fetch the data.
- Database operation: To save the data into the db.