Interview QuestionPractical QuestionFollow-up Questions

Differences Between APK and AAB

skydovesJaewoong Eum (skydoves)||10 min read

Differences Between APK and AAB

Android applications are distributed using two primary formats: APK (Android Package) and AAB (Android App Bundle). The APK is the traditional installable format that contains all resources for all device configurations. The AAB is a publishing format introduced by Google that enables the Play Store to generate optimized, device specific APKs at download time. Understanding the structural and distributional differences between these formats is important for choosing the right delivery strategy. By the end of this lesson, you will be able to:

  • Explain the structural differences between APK and AAB files.
  • Describe how Google Play processes an AAB into device specific APKs.
  • Identify the size reduction benefits of AAB over universal APK distribution.
  • Explain when APK is still necessary despite AAB being the recommended format.

APK Structure

An APK is a self contained archive that includes everything needed to install and run an application on any compatible device. It contains compiled DEX code, all resources for every screen density, all native libraries for every CPU architecture, and all language resources regardless of the device's locale.

This universality means a single APK works on any device, but it also means every user downloads resources they will never use. A device with an xxhdpi screen still receives mdpi, hdpi, and xxxhdpi drawables. A device with an arm64-v8a CPU still receives x86 and armeabi-v7a native libraries.

APK files can be installed directly on a device through adb install, sideloaded from file managers, or distributed through any app store.

AAB Structure

An AAB is a modular publishing format that separates resources and code into distinct bundles based on device configuration. It is not directly installable. When a developer uploads an AAB to Google Play, the Play Store processes it through its Dynamic Delivery system.

Google Play generates a set of split APKs for each device configuration:

  • Base APK: Contains the core code and resources common to all devices.
  • Configuration APKs: Contain resources specific to screen density, CPU architecture, and language.

When a user downloads the app, Google Play delivers only the base APK plus the configuration APKs that match the device. An arm64-v8a device with xxhdpi density and English locale receives only those specific splits.

android {
    bundle {
        density { enableSplit true }
        abi { enableSplit true }
        language { enableSplit true }
    }
}

Size Comparison

The size reduction from AAB delivery depends on the app's resource composition. Apps with many density specific drawables, multiple native library architectures, and numerous language translations see the largest reductions. Google reports that apps using AAB deliver APKs that are on average 15 percent smaller than universal APKs, with some apps seeing reductions of 30 percent or more.

The savings come entirely from excluding resources the device does not need. The code itself is not compressed differently between the two formats.

This interview continues for subscribers

Subscribe to Dove Letter for full access to exclusive interviews about Android and Kotlin development.

Become a Sponsor