โ† All AAD Flashcard Decks

AAD Jetpack Libraries & Modern Android Development Flashcards

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

Read the first 6 AAD Jetpack Libraries & Modern Android Development flashcards as text
  1. What is the purpose of a Repository in Android's recommended app architecture?

    Answer: Act as the single source of truth abstracting data sources from the ViewModel

    A Repository mediates between data sources (Room, network APIs) and the ViewModel, providing a clean API and ensuring the ViewModel does not depend on specific data sources.

  2. Which Paging 3 component is responsible for defining how data is loaded from a source?

    Answer: PagingSource

    PagingSource is the class you extend to define how paginated data is loaded from a single source such as a database or a network API.

  3. What is the correct way to observe a Flow from a ViewModel inside a Fragment using Jetpack?

    Answer: lifecycleScope.launch { viewModel.flow.collect { } }

    Using lifecycleScope.launch inside a Fragment ensures the coroutine collecting the Flow is cancelled when the Fragment's lifecycle is destroyed, preventing leaks.

  4. What does @HiltViewModel accomplish in a ViewModel class?

    Answer: Allows Hilt to inject dependencies into the ViewModel automatically

    @HiltViewModel tells Hilt to generate the necessary code to inject constructor dependencies into the ViewModel without needing a custom ViewModelProvider.Factory.

  5. In Room, what is the purpose of a migration object when updating the database schema?

    Answer: Define SQL statements that transform the old schema to the new one without data loss

    A Room Migration provides the SQL ALTER or other statements needed to upgrade the database from one version to another while preserving existing user data.

  6. Which Compose modifier is used to make a UI element clickable and provide ripple feedback?

    Answer: .clickable()

    .clickable() is the standard Compose modifier that makes any composable respond to tap gestures and automatically applies Material ripple visual feedback.