Development (Android)
Objective Assessment Review
(Questions & Solutions)
2025
©2025
, Question 1
A development team is optimizing an Android app’s responsiveness.
When an activity is first launched, which of the following lifecycle
methods is guaranteed to be called exactly once before the activity
becomes visible?
- A. onStart()
- B. onResume()
- C. onCreate()
- D. onPause()
ANS: C
Rationale: The onCreate() method is called only once during the
lifetime of an activity instance to perform all initial setup (such as
inflating the layout and binding data). This initialization step is key to
establishing a stable baseline for the activity’s further lifecycle.
---
Question 2
Which Android Jetpack component is specifically designed to store and
manage UI-related data in a lifecycle-conscious way, thereby surviving
configuration changes such as device rotations?
- A. LiveData
- B. ViewModel
- C. Room
- D. Navigation Component
ANS: B
Rationale: The ViewModel component is intended to store and manage
UI data and survives configuration changes, preventing unnecessary
reloading of data when the activity or fragment is recreated.
---
©2025
, Question 3
A mobile app relies on offline-first capabilities and must synchronize data
when an Internet connection becomes available. Which Android
architecture component best facilitates asynchronous background
processing for this purpose?
- A. AsyncTask
- B. JobScheduler
- C. WorkManager
- D. IntentService
ANS: C
Rationale: WorkManager is a robust, lifecycle-aware component meant
for deferrable, asynchronous tasks that need reliable execution across
app restarts and even after system reboots, making it ideal for offline-
first syncing.
---
Question 4
When designing a complex user interface for an Android application that
must run on a wide range of devices, which design technique best
ensures that layouts adapt fluidly to different screen sizes and
orientations?
- A. Fixed pixel-based layouts
- B. Responsive layouts using constraint layouts and resource qualifiers
- C. Hard-coded dimensions in Java
- D. Utilizing only relative layouts
ANS: B
Rationale: Using responsive layouts (e.g., ConstraintLayout or
GridLayout) combined with resource qualifiers enables interfaces to scale
and reflow properly on different devices and orientations, providing
optimal usability across the board.
©2025
, ---
Question 5
Which Android persistence library leverages an abstraction layer over
SQLite to reduce boilerplate code while providing compile-time
verification of SQL queries?
- A. Realm
- B. GreenDAO
- C. Room
- D. ORMLite
ANS: C
Rationale: Room is the modern persistence library recommended by
Android that simplifies database access with minimal boilerplate while
ensuring safety with compile-time verification.
---
Question 6
A development team wants to ensure that UI updates occur only when
the activity is in a valid lifecycle state. Which Android component helps
accomplish this by holding observable data that respects lifecycle
changes?
- A. Service
- B. LiveData
- C. BroadcastReceiver
- D. ContentProvider
ANS: B
Rationale: LiveData is lifecycle-aware and ensures that observers
receive updates only when their corresponding activities or fragments
are in active states, preventing potential crashes or unexpected behavior.
---
©2025