Which of the following techniques directly reduces the APK size by removing unused code and resources?
Think about tools that remove unused parts of your code and resources.
ProGuard and R8 analyze your code and resources to remove unused parts, which reduces APK size. Increasing minSdkVersion or adding more resources can increase size. MultiDex helps with method limits but does not reduce size.
You replace all PNG images with vector drawables in your Android app. What is the most likely effect on the app size and UI?
Think about how vector images work compared to bitmaps.
Vector drawables use XML to describe images, which usually reduces app size and scales smoothly on different screen sizes. They are supported on Android 5.0+ and via support libraries on older versions.
Your app includes multiple resource folders for different screen densities (mdpi, hdpi, xhdpi, xxhdpi). What happens to the APK size and resource loading when you build a universal APK?
Consider what happens when you bundle resources for all devices in one APK.
A universal APK includes all resources for all densities, increasing APK size. At runtime, the device loads only the matching density resources, ignoring others.
You want to reduce initial download size by delivering some features only when needed. Which Android feature allows this behavior?
Think about modularizing features and downloading them on demand.
Dynamic Feature Modules let you separate features into modules that users download only when needed, reducing initial APK size. MultiDex and ProGuard help with code but not on-demand delivery.
Given this Kotlin snippet in an Android app, what is the value of unusedResourcesCount after running?
val resources = listOf("icon.png", "background.jpg", "unused.png")
val usedResources = listOf("icon.png", "background.jpg")
val unusedResourcesCount = resources.count { it !in usedResources }Count how many items in resources are not in usedResources.
Only "unused.png" is not in usedResources, so the count is 1.