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
Your app targets API 33+ and needs to show notifications. What must you do first?
Answer: Request the POST_NOTIFICATIONS runtime permission
Android 13 (API 33) introduced the POST_NOTIFICATIONS runtime permission, which users must grant before notifications appear.
What is the main advantage of using ConstraintLayout over deeply nested LinearLayouts?
Answer: A flatter view hierarchy, which improves layout measurement performance
ConstraintLayout positions views with constraints in a single flat layer, avoiding costly nested measure passes.
A QA engineer wants to test an Activity's UI interactions automatically on a device. Which framework is designed for this?
Answer: Espresso
Espresso drives and asserts on real UI components in instrumented tests running on a device or emulator.
What happens to an app's process when the system is low on memory and the app is in the background?
Answer: The system may kill the process, and saved instance state helps restore the UI later
Android reclaims memory by killing background processes, so apps must save state to restore correctly on return.
In Kotlin, what does a 'sealed class' provide when modeling UI states like Loading, Success, and Error?
Answer: A restricted class hierarchy enabling exhaustive when-expression handling
Sealed classes limit subclasses to a known set, so a when expression can be checked for exhaustiveness at compile time.
Which statement about App Bundles (.aab) versus APKs is correct?
Answer: Play generates optimized per-device APKs from the bundle, reducing download size
The Android App Bundle lets Google Play deliver split APKs containing only the resources and code each device needs.
What is the purpose of ProGuard/R8 in a release build?
Answer: Shrinking, obfuscating, and optimizing code to reduce size and hinder reverse engineering
R8 removes unused code, renames symbols, and optimizes bytecode in release builds.