APKs (Android Package) and AABs (Android App Bundle) are both file formats used for distributing applications on the Android platform, but they serve different purposes and have different characteristics. Understanding the differences in these formats will help us understand the natural evolution in the way Android apps are built.
APK (Android Package):
- APK is the traditional file format used to distribute Android applications.
- It contains all of the resources and code needed to run the application on an Android device.
- APK files are larger in size because they include resources for all device configurations (e.g., different screen sizes, CPU architectures, languages).
- Developers need to generate multiple APKs to support different device configurations, leading to increased complexity in managing and distributing the app.
AAB (Android App Bundle):
- AAB is a more modern and efficient format introduced by Google.
- It doesn't contain all resources and code like APK. Instead, it includes only the resources and code that are necessary for a particular device configuration.
- AAB leverages Google Play's Dynamic Delivery feature, which allows Google Play to generate optimized APKs tailored to each user's device configuration at the time of installation. This helps reduce the size of the downloaded app and ensures users receive only the resources they need.
- AAB files are smaller compared to APKs because they don't include resources for all device configurations upfront.
As the points above would suggest, the main problem with APKs is their size. A single APK file contains assets and resources to run an app on a variety of Android devices. In other words, users have to download all of the resources and assets onto their device storage even if most of them are not even needed to make the app work. This need to create apps for a range of device configurations causes a direct increase in the size of APK files.
This has been the major inefficiency in the way APK-built apps operate. High app sizes cause a whole range of problems, from lower install success rates to higher app churn.
AABs address the problems that APK-builds create. The following points explain how they work.
- Developers first create an AAB build of their app.
- The next step is uploading the AAB file to Google Play. As soon as the AAB is uploaded, Google Play divides the bundle into different split APK files. Each split APK contains resources and assets to operate within a given device configuration.
- Every device an app supports gets a different split APK.
- When users on the Google Play Store press the install button, a split APK is downloaded to their device. The APK downloaded only contains the specific resources and assets needed to make the app work on a given device.
Google Play parses through the different assets and resources in an AAB file and creates a whole set of split APK files. Each split APK caters to a specific device configuration.
Using an AAB build basically ensures app users don’t have to download unnecessary resources. App size is reduced significantly and the problem of high app churn with APKs is avoided.
Looking at the various advantages of AAB files, the recent shift to using them in Android apps shows a natural progression toward a better technical solution. While you might assume APKs have lost their relevance with the move toward AABs, the only way to install an Android app still involves APKs. AABs are simply a newer and better method of organizing app files and resources.