The APK (Android Package)

The APK, or Android Package, is the file format Android uses to distribute and install an application. An APK follows the ZIP file format: it is a single archive that bundles together everything needed to install and run an app. Present since Android’s first release in 2008, the .apk file is the unit a device installs, and historically the unit that app stores distributed. Its ZIP basis means an APK can be inspected with ordinary archive tools, and Android Studio ships an APK Analyzer for examining the contents and size of a built package.

Inside the archive, an APK contains a small number of well-defined parts. The AndroidManifest.xml file declares the app’s package name, components (activities, services, broadcast receivers), permissions, and the intent filters that let the app respond to implicit intents. One or more DEX files hold the app’s compiled code as Dalvik Executable bytecode, the format that Android’s runtime (originally the Dalvik virtual machine, later ART) executes rather than standard Java class files. The archive also carries the app’s resources: layouts, images, strings, and a compiled resources table. Every APK that is installed must be cryptographically signed, which ties the package to a developer key and allows the system to verify updates come from the same author.

The DEX format is central to what makes an APK an Android artifact rather than a generic Java package. Source code written in Java or Kotlin is compiled first to standard JVM bytecode and then transformed by the SDK’s build tools into Dalvik Executable (DEX) bytecode optimized for the constrained, mobile runtime Android originally targeted. A single APK can contain multiple DEX files (multidex) when an app’s method count exceeds the limits of a single DEX file. The build pipeline that produces a signed APK from sources and resources is driven by the Android SDK build tools, typically invoked through Gradle.

In 2018 Google introduced the Android App Bundle (AAB) as a new publishing format that layers on top of the APK model. An app bundle is a signed file, also in ZIP archive format, that organizes an app’s code and resources into modules but is not directly installed. Instead, the developer uploads the bundle to Google Play, and Play generates and signs optimized APKs tailored to each user’s device configuration, delivering only the code and resources that device needs. Unlike an APK, an app bundle stores each module’s manifest and DEX files in separate directories, and Google Play later assembles split APKs from them. In 2021 the App Bundle became the required publishing format for new apps on Google Play.

The APK remains the format that actually lands on a device even under the App Bundle model: split APKs generated from a bundle still contain compiled DEX bytecode, resources, and a manifest, just as a classic monolithic APK does. As the concrete container for an Android app, the APK ties together several other entries in this library, the manifest’s intent filters, the DEX bytecode run by the Dalvik and ART runtimes, and the distribution path through Google Play.