Android Performance Optimization 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 Performance Optimization flashcards as text
What does APK size optimization technique 'code shrinking' do via R8 or ProGuard?
Answer: Removes unused classes, fields, methods, and attributes from the compiled output
Code shrinking with R8/ProGuard analyzes the code graph and removes unused classes, fields, methods, and attributes, producing a smaller, faster APK.
What is the purpose of Android App Bundles (.aab) compared to traditional APKs?
Answer: They let Google Play deliver only the resources and code needed for a specific device
App Bundles enable Dynamic Delivery, where Google Play generates and serves optimized APKs containing only the resources and code needed for each specific device configuration.
Which Android image format is preferred for app assets because it offers superior lossless and lossy compression compared to PNG and JPEG?
Answer: WebP
WebP provides significantly better compression than PNG (lossless) and JPEG (lossy) at comparable quality, reducing APK size and runtime memory usage.
What is the role of the 'launch profiling' feature in Android Studio's CPU Profiler?
Answer: It records CPU activity from the very beginning of app startup to diagnose slow launches
Launch profiling captures CPU traces from process start, enabling developers to identify initialization bottlenecks that contribute to slow cold or warm start times.
When using DiffUtil with RecyclerView, what is the main performance advantage over calling notifyDataSetChanged()?
Answer: It calculates the minimal set of changes and animates only affected items
DiffUtil computes the difference between two lists and dispatches granular add/remove/move/change events, avoiding the full rebind that notifyDataSetChanged() triggers.
What does the Android vitals metric 'ANR rate' measure?
Answer: The percentage of daily active users who experienced an Application Not Responding dialog
ANR (Application Not Responding) rate in Android vitals measures the proportion of daily active users who encountered an ANR dialog, a key indicator of main-thread blocking issues.
Which approach minimizes object allocation in performance-critical Android code to reduce garbage collection pauses?
Answer: Use StringBuilder instead of String concatenation in tight loops
String concatenation with + in a loop creates many intermediate String objects; StringBuilder reuses its internal buffer, reducing GC pressure in tight loops.