File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
app/src/main/java/com/example/android/devbyteviewer Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,22 @@ import timber.log.Timber
25
25
*/
26
26
class DevByteApplication : Application () {
27
27
28
+ // TODO (01) Create CoroutineScope variable applicationScope, using Dispatchers.Default.
29
+
30
+ // TODO (02) Create a delayedInit() function that calls setupRecurringWork() in
31
+ // the coroutine you defined above.
32
+
33
+ // TODO (04) Create a setupRecurringWork() function and use a Builder to define a
34
+ // repeatingRequest variable to handle scheduling work.
35
+
36
+ // TODO (05) In setupRecurringWork(), get an instance of WorkManager and
37
+ // launch call enqueuPeriodicWork() to schedule the work.
38
+
39
+ // TODO (07) In setupRecurringWork(), define constraints to prevent work from occurring when
40
+ // there is no network access or the device is low on battery.
41
+
42
+ // TODO (08) Add the constraints to the repeatingRequest definition.
43
+
28
44
/* *
29
45
* onCreate is called before the first screen is shown to the user.
30
46
*
@@ -34,5 +50,6 @@ class DevByteApplication : Application() {
34
50
override fun onCreate () {
35
51
super .onCreate()
36
52
Timber .plant(Timber .DebugTree ())
53
+ // TODO (03) Call delayedInit().
37
54
}
38
55
}
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ import retrofit2.HttpException
26
26
27
27
class RefreshDataWorker (appContext : Context , params : WorkerParameters ):
28
28
CoroutineWorker (appContext, params) {
29
+
30
+ // TODO (06) Create a companion object and define a WORK_NAME constant.
31
+
29
32
/* *
30
33
* A coroutine-friendly method to do your work.
31
34
*/
You can’t perform that action at this time.
0 commit comments