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
What is the primary purpose of ViewModel in Android Jetpack?
Answer: Store and manage UI-related data that survives configuration changes
ViewModel is designed to store and manage UI-related data in a lifecycle-conscious way so that data survives configuration changes like screen rotations.
Which Jetpack component is used to schedule deferrable, guaranteed background work?
Answer: WorkManager
WorkManager is the Jetpack library for scheduling deferrable, constraint-aware background tasks that are guaranteed to run even if the app exits or the device restarts.
What type does LiveData emit that makes it lifecycle-aware?
Answer: It only delivers updates to observers in an active lifecycle state
LiveData is lifecycle-aware and only notifies observers that are in an active lifecycle state (STARTED or RESUMED), preventing crashes and memory leaks.
In Jetpack Navigation, what is a NavGraph?
Answer: An XML resource that defines destinations and actions for in-app navigation
A NavGraph is an XML resource file that centralizes all navigation destinations (Fragments, Activities) and the actions connecting them in one place.
What annotation marks a method as a database query in a Room DAO?
Answer: @Query
@Query is the Room annotation used on DAO methods to define custom SQL SELECT (or other) statements to retrieve data from the database.
Which class in Jetpack's Data Binding library is automatically generated for each layout file?
Answer: A Binding class named after the layout file in PascalCase + 'Binding'
For a layout file named activity_main.xml, Data Binding generates ActivityMainBinding, a class that provides direct references to all bound views and variables.