Skip to main content
InterviewHubPRO
Section Overview
Q17

Question 17 of 50

Part 2: Compose Internals, Persistence, DI & Background Work (11 - 24)

34%
Android & Jetpack Compose (50 Qs)•Part 2: Compose Internals, Persistence, DI & Background Work (11 - 24)

What is ProGuard / R8 and how does it optimize Android APK/AAB size?

senior LevelDocker & Containers

In Simple Words: R8 is the default compiler and code shrinker for Android builds:

  1. Shrinking: Tree-shakes and strips unused classes, fields, and library methods.
  2. Optimization: Inlines functions, removes dead branches, and optimizes bytecode.
  3. Obfuscation: Renames classes and methods to short unreadable names (a.b.c()), reducing DEX file size and preventing reverse engineering.
  • Requires maintaining Proguard Rules (-keep class ...) for classes accessed via reflection (e.g. JSON data models).