This video shows how to use WorkManager in Android Kotlin. We also write tests for our WorkManager
WorkManager supports:
- One-off and periodic tasks
- Constraints, such as network availability
- Chaining tasks, parallel or sequentially
- Observable task state for display in UI
- Customise threading strategy
Using WorkManager in Android | Schedule Tasks | Test WorkManager
0:08 Demo of OneTimeWorkRequest
1:28 Demo of PeriodicWorkRequest
1:55 Step 1 : Setup Gradle dependencies
2:05 Step 2 : Manifest and Application
2:42 Step 3.1 : Create OnDemandBackupWorker
3:52 Step 3.2 : Create FileWorker
5:00 Step 4 : Create ViewModel
7:04 Step 5 : Change in MainActivity
8:05 Step 6 : Create PeriodicBackupWorker
8:40 Step 7 : Change Application Class
9:13 Step 8 : Testing OnDemandBackupWorker
10:11 Step 9 : Testing PeriodicBackupWorker
Source Code: https://github.com/AseemWangoo/hands_on_kotlin
#android #kotlin