Challenge 1: A One-Time Sync Worker — Solution class LogSyncWorker( context: Context, params: WorkerParameters ) : CoroutineWorker(context, params) { override suspend fun doWork(): Result { Log.d("LogSyncWorker", "Sync work executed") return Result.success() } } @Composable fun SyncButton() { val context = LocalContext.current Button(onClick = { val syncRequest = OneTimeWorkRequestBuilder().build() WorkManager.getInstance(context).enqueue(syncRequest) }) { Text("Sync Now") } } Notes: - LogSyncWorker's constructor signature (context: Context, params: WorkerParameters) is required exactly as written — WorkManager itself calls this constructor internally when it decides to run the work, so the parameters must match what CoroutineWorker expects. - LocalContext.current is how a composable accesses the current Context — needed here because WorkManager.getInstance(context) requires one, and Compose doesn't automatically provide it the way an Activity's "this" would. - Tapping the button enqueues the work but does NOT guarantee it runs instantly — WorkManager decides when to actually execute it (typically very soon, for an unconstrained OneTimeWorkRequest like this one, but not synchronously on the click itself).