โ† All Android Development Flashcard Decks

Android Background Processing Flashcards

6 cards from real Android Development practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Android Background Processing flashcards as text
  1. What is the purpose of CoroutineScope in Kotlin?

    Answer: To define the lifecycle and context in which coroutines run

    CoroutineScope defines a scope for launching coroutines, ensuring they are cancelled when the scope is cancelled (e.g., when a ViewModel is cleared).

  2. Which WorkManager class is used to chain multiple work tasks sequentially?

    Answer: WorkContinuation

    WorkContinuation allows you to create chains of WorkRequests that execute sequentially or in parallel using then() and combine() methods.

  3. What does the suspend keyword do to a Kotlin function?

    Answer: Marks it as a suspending function that can be paused and resumed

    The suspend keyword marks a function as a coroutine that can suspend its execution without blocking the calling thread.

  4. Which Android component replaced IntentService for background processing?

    Answer: Both A and B

    Both WorkManager and JobIntentService replaced IntentService, with WorkManager being preferred for most deferrable background work.

  5. What is the viewModelScope in Android?

    Answer: A CoroutineScope tied to the ViewModel's lifecycle that cancels when the ViewModel is cleared

    viewModelScope is an extension property on ViewModel that provides a CoroutineScope automatically cancelled when the ViewModel is destroyed.

  6. How do you specify Constraints for a WorkManager WorkRequest?

    Answer: Using the Constraints.Builder class

    Constraints.Builder is used to build a Constraints object specifying network type, charging state, storage, and other requirements for work execution.

Android Background Processing Flashcards โ€” Android Development Study Cards with Answers