Font size
WorksheetsAndroid Development Multiple Choice Questions
Total questions: 100
Worksheet time: 53mins
What object is used to request an action from another component?
Message
Intent
Packet
Signal
Which Intent type targets a specific app component directly?
Explicit Intent
Direct Intent
Hard Intent
Implicit Intent
Which Intent type asks the system to handle an action?
General Intent
Explicit Intent
Soft Intent
Implicit Intent
What data structure manages the history of visited activities?
Task Queue
History List
Back Stack
App Stack
Which navigation button moves up the app's hierarchy?
Back button
Up button
Home button
Menu button
Which navigation button moves to the previous screen historically?
Recent button
Back button
Exit button
Up button
What represents a reusable portion of UI within an activity?
Fragment
Activity
Intent
Service
Which Jetpack library simplifies app navigation?
Router
Pathfinder
Navigator
Navigation Component
Which XML resource defines all navigation paths?
Path Config
Navigation Graph
Sitemap
Route Map
Which container swaps destinations in the Navigation Component?
NavHost
NavContainer
ScreenFrame
FragmentHolder
Which object manages app navigation within a NavHost?
NavController
NavManager
RouteController
PathGuide
What are individual screens (fragments) called in a NavGraph?
Destinations
Points
Stops
Nodes
What connects two destinations in a NavGraph?
Path
Link
(a) Segment (b) Part (c) Section (d) Fragment
Segment
Part
Section
Fragment
What Gradle plugin ensures type-safe argument passing?
TypeCheck
ArgGuard
IntentSafe
Safe Args
Does a Fragment have its own lifecycle?
No
Only when added
Only in dialogs
Yes
Which Fragment method is used to inflate its layout?
onCreateView()
onCreateLayout()
onInflate()
onViewInit()
Which UI pattern displays a side menu?
Hamburger Menu
Side Bar
Slide Menu
Navigation Drawer
Which layout acts as a container for a Navigation Drawer?
DrawerLayout
MenuLayout
SlidingLayout
SideLayout
What component typically provides the "hamburger" icon?
Status Bar
Action Bar
Toolbar / App Bar
Nav Bar
Which navigation pattern uses a bar at the bottom of the screen?
Bottom Navigation
Tab Bar
Footer
Lower Menu
Which state indicates an Activity is initializing?
Resumed
Active
Started
Created
Which lifecycle method is the first to be called?
onInit()
onResume()
onCreate()
onStart()
In which state is the Activity visible but not interactive?
Resumed
Created
Paused
Started
Which state indicates the Activity has user focus?
Resumed
Active
Running
Started
Which method is called when the Activity is partially obscured?
onPause()
onHide()
onBackground()
onStop()
Which method is called when the Activity is no longer visible?
onPause()
onEnd()
onStop()
onDestroy()
Which method performs final cleanup before destruction?
onDestroy()
onDelete()
onTrash()
onCleanup()
What happens to the Activity when the device is rotated?
It is destroyed and recreated
Nothing happens
It is paused
It is stopped
Which method is used to save UI state before destruction?
persist()
saveState()
onSaveInstanceState()
onBackup()
What object stores the saved state data?
Dictionary
Bundle
Package
Map
Which specific Fragment method is called when associated with context?
onConnect()
onBind()
onAttach()
onLink()
Which specific Fragment method is called when disassociated?
(a)
Which class allows logging debug messages?
Console
Log
Debug
Which Log method is for informational messages?
Log.e()
Log.v()
Log.i()
Log.d()
Which package provides lifecycle-aware components?
androidx.lifecycle
android.aware
android.life
androidx.component
What interface does an Activity implement to show it has a lifecycle?
LifecycleHolder
LifecycleOwner
Owner
Host
What interface observes lifecycle changes?
LifecycleObserver
Monitor
Listener
Watcher
What is a collection of activities that the user interacts with called?
Process
Task
Group
Job
Does the Back Stack follow LIFO (Last In, First Out)?
FIFO
No
Random
Yes
Which method is called when an Activity starts after being stopped?
onRestart()
onReboot()
onRelapse()
onResume()
What principle suggests dividing code into distinct sections?
Separation of concerns
Don't repeat yourself
Keep it simple
Single responsibility
Which component should handle UI logic and data preparation?
Activity
XML
Fragment
ViewModel
Which component typically displays data but stays passive?
Database
ViewModel
UI Controller (Activity/Fragment)
Repository
Does a ViewModel survive configuration changes like rotation?
No
Yes
Only in background
Only if saved
Which class is used to create or retrieve a ViewModel?
ViewModelFactory
VMCreate
ViewModelProvider
ViewModelBuilder
What is an observable data holder class?
LiveData
Stream
Observable
Flow
Which LiveData subclass allows updating its value?
WriteableLiveData
ChangeableLiveData
DynamicData
MutableLiveData
How do you listen for changes in LiveData?
observe()
watch()
subscribe()
listen()
LiveData is "lifecycle-aware". What does this mean?
Updates only active observers
Updates on background
Does not update
Updates always
What binding syntax is used for two-way data binding?
@{...}
${...}
@={...}
#{...}
Which helper class transforms LiveData values?
(a)
Which transformation modifies the value itself?
edit()
modify()
map()
change()
Which transformation converts to a new LiveData source?
toggle()
switchMap()
swap()
flatMap()
What is needed to pass arguments to a ViewModel constructor?
Injector
ArgLoader
Builder
ViewModelFactory
Where should UI state be stored to persist across rotation?
Activity
ViewModel
View
Intent
What pattern describes events flowing up and data flowing down?
Bidirectional flow
Circular flow
Unidirectional Data Flow
Linear flow
Why should ViewModel not hold a reference to a View?
To prevent memory leaks
Views are null
It crashes
It is not allowed
Which ViewModel subclass provides access to the Application context?
GlobalViewModel
AndroidViewModel
ContextViewModel
AppViewModel
What Gradle build feature enables Data Binding?
buildFeatures { dataBinding true }
enableDataBinding
useDataBinding
bindingOn
What does the 'Observer' interface require implementing?
onEvent()
onChanged()
onNotify()
onUpdate()
Which storage type is volatile and lost on reboot?
Flash
Disk
SSD
RAM
Which API stores simple key-value pairs?
SQLite
Room
File
SharedPreferences
Which storage option allows saving private files?
Internal Storage
External Storage
Which database engine is built into Android?
MySQL
MongoDB
PostgreSQL
SQLite
Which Jetpack library provides an abstraction over SQLite?
Room
House
Floor
Realm
What represents a table in Room?
Class
Entity
Object
Row
Which annotation marks a class as a Room Entity?
@Table
@Entity
@Database
@Row
What allows accessing the database?
DTO
DAO (Data Access Object)
Service
API
Which annotation marks an interface as a DAO?
@Interface
@Access
@Query
@Dao
Which annotation is used for raw SQL commands?
@SQL
@Raw
@Query
@Command
Which annotations perform modification operations?
@Insert, @Update, @Delete
@Put, @Patch, @Cut
@New, @Change, @Drop
@Add, @Edit, @Remove
Which component serves as the main access point to the DB?
Database
Controller
Manager
Gateway
Which annotation defines the primary key of a table?
@Key
@Id
@PrimaryKey
@Unique
Why should database operations run asynchronously?
Android requires it
To save battery
They are fast
To prevent blocking the main thread
What feature provides lightweight threads for async code?
Processes
Coroutines
Tasks
Threads
Which keyword marks a function that can be paused?
(a)
Which Dispatcher is optimized for disk/network IO?
Dispatchers.Main
Dispatchers.Default
Dispatchers.IO
Dispatchers.GPU
Which Dispatcher is used for UI updates?
Dispatchers.Background
Dispatchers.IO
Dispatchers.Job
Dispatchers.Main
Which scope launches coroutines tied to a ViewModel?
mainScope
globalScope
lifecycleScope
viewModelScope
What does '@Volatile' ensure for a variable?
Immutability
Security
Visibility changes to other threads
Persistence
Which adapter subclass computes list differences efficiently?
SmartAdapter
ListAdapter
RecyclerAdapter
FastAdapter
Which utility class calculates the difference between two lists?
(a)
Which callback method checks if two items represent the same object?
equals()
isSame()
compare()
areItemsTheSame()
Which callback method checks if item content matches?
isContentEqual()
match()
check()
areContentsTheSame()
Which method submits a new list to the ListAdapter?
updateList()
push()
submitList()
setList()
What allows creating custom XML attributes for binding?
Custom Views
Attr Setters
XML Hooks
Binding Adapters
Which annotation declares a Binding Adapter?
@Custom
@Bind
@Adapter
@BindingAdapter
Which method returns the view type for a position?
getItemViewType()
getClass()
getView()
getType()
What class type is useful for defining a restricted set of view types?
abstract class
sealed class
interface
open class
Which LayoutManager arranges items in a grid?
MatrixLayout
TableLayout
BoxManager
GridLayoutManager
What parameter determines the number of columns in a grid?
spanCount
size
width
colCount
What class allows dynamic sizing of grid items?
GridHelper
SizeCalc
SpanSizeLookup
SpanManager
How are headers typically handled in a RecyclerView?
Sticky view
Overlay
As a different ViewType
Separate list
Why is ListAdapter better than notifyDataSetChanged?
Better performance with animations
Typesafety
Easier to write
Less code
What method executes generic pending bindings immediately?
How can you cache the binding object in a ViewHolder?
In onBind
Static map
Global variable
In the constructor
Where should item click listeners usually be set?
In XML
In onBind
In MainActivity
In the ViewHolder
What allows multiple ViewHolders in one Adapter?
Overloading
Different view types
Generic types
Subclassing
Can a RecyclerView display heterogeneous data?
Yes
Only images
No
Only strings
