โ† All Android Development Flashcard Decks

Android Development Flashcards

7 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 7 Android Development flashcards as text
  1. Which lifecycle callback is invoked when an Activity is partially obscured by a dialog-themed Activity but still visible?

    Answer: onPause()

    onPause() fires when the Activity loses focus but remains partially visible, while onStop() only fires when fully hidden.

  2. In Jetpack Compose, what happens when a State object read inside a composable changes its value?

    Answer: The composable that reads it is scheduled for recomposition

    Compose tracks state reads and automatically recomposes only the composables that read the changed state.

  3. A developer needs to run a task that must complete even if the user closes the app, such as uploading logs nightly. Which API is the recommended choice?

    Answer: WorkManager

    WorkManager guarantees deferrable, persistent background work that survives app exits and device restarts.

  4. What is the primary purpose of the AndroidManifest.xml file?

    Answer: Declaring app components, permissions, and metadata to the system

    The manifest declares Activities, Services, permissions, and other essential app information to the Android system.

  5. Which storage option is most appropriate for saving a small set of key-value user settings, such as a dark-mode flag?

    Answer: DataStore (or SharedPreferences)

    DataStore, the modern replacement for SharedPreferences, is designed for small key-value or typed settings data.

  6. What does the 'lateinit' modifier in Kotlin allow in an Android class?

    Answer: Declaring a non-null var that is initialized after construction, e.g. in onCreate()

    lateinit defers initialization of a non-null var, commonly used for views or dependencies set up in onCreate().

  7. Which component should be used to expose an app's data to other applications in a secure, structured way?

    Answer: ContentProvider

    ContentProvider is the standard component for sharing structured data across app boundaries with permission control.