The Deska blog
App Bundles and Dynamic Delivery for Android Optimization
Learn how to optimize app size and distribution using Android App Bundles and Dynamic Delivery to improve install rates and storage efficiency.
10 min read
Optimizing the delivery of mobile software is a critical stage in the development lifecycle. As applications grow in complexity, managing the app size android app bundles produce becomes essential for maintaining high conversion rates in the Play Store. Users with limited storage or slow internet connections often abandon large downloads, making efficient distribution a technical necessity. By transitioning from the traditional monolithic APK to the Android App Bundle format, developers can leverage Google Play Asset Delivery and Dynamic Delivery to ensure that users only download the code and resources required for their specific device configuration.
The Evolution from APK to Android App Bundle
For many years, the Android Package (APK) was the standard for distribution. An APK is a single compressed file containing every possible resource: all screen densities, all language strings, and all CPU architectures. This approach is simple but wasteful. A user with a high density screen still downloads assets intended for low density screens, wasting bandwidth and storage.
The Android App Bundle (AAB) changed this paradigm. Unlike an APK, an AAB is a publishing format. You upload the bundle to the Google Play Console, and the store generates optimized APKs for each user. This process, known as Dynamic Delivery, extracts only the necessary resources. If a user has an ARM64 device with a high density screen and the locale set to Spanish, they receive an APK containing only those specific components. This significantly reduces the total footprint on the device.
Core Mechanisms of Dynamic Delivery
Dynamic Delivery relies on the concept of split APKs. This mechanism allows the operating system to treat multiple APK files as a single application. There are three primary types of splits involved in this process.
- Base APK: Contains the core logic and resources that every user needs to run the application.
- Configuration APKs: These include specific resources for screen density, CPU architecture, and native libraries.
- Feature APKs: These contain code and resources for specific features that do not need to be present at the time of the initial installation.
By separating these concerns, developers can implement Play Feature Delivery. This allows for conditional loading, where a specific module is only downloaded if the user meets certain criteria, such as having a device with a high end camera or residing in a specific country. It also enables on demand delivery, where a feature is downloaded only when the user attempts to access it within the UI.
Impact on Development Workflows
Transitioning to App Bundles requires a shift in how projects are structured. Developers must modularize their code using Gradle feature modules. This modularity does not just help with final distribution; it also improves build times by allowing for parallel compilation and better caching.
During this transition, managing various terminals and build logs can become overwhelming. Tools like Deska provide a helpful environment for this type of complex work. In Deska, you can use the infinite canvas to place multiple terminals side by side. This allows you to monitor the build process of the base module in one panel while running linting or testing on a feature module in another. The ability to zoom out and see the entire architectural flow helps in visualizing how different modules interact before they are bundled for distribution.
Comparing Distribution Formats
The following table highlights the key differences between the traditional APK method and the modern App Bundle approach.
| Feature | Monolithic APK | Android App Bundle |
|---|---|---|
| Size | Includes all resources | Optimized for specific devices |
| Security | Signed by developer | Signed by Google Play |
| Complexity | Low | Medium (requires modularization) |
| Feature Loading | All at once | On demand or conditional |
| Support | All Android versions | Split APKs require Android 5.0+ |
While APKs are still useful for side loading or internal testing, the AAB format is now the requirement for new apps on Google Play. Developers should use the AAB for production and reserve APKs for distribution channels that do not support dynamic delivery.
Managing Complex Migrations with Deska
Moving a large project to a modular architecture is a significant undertaking. It involves refactoring dependencies and ensuring that the base module does not inadvertently depend on feature modules. This is where coding agents can assist. Within Deska, you can run agents like Claude Code or OpenCode in separate panels. These agents can help analyze your build.gradle files to identify circular dependencies or suggest ways to decouple components for cleaner feature delivery.
Because Deska is local-first, your source code and build configurations remain on your machine. The code editor allows for quick adjustments to your Manifest files while you consult the browser widgets for the latest documentation on split APK management. If you need to step away from your desk while a long build is running, the mobile app allows you to monitor the terminal output through a secure relay. This ensures you can check the progress of your bundle generation without being tethered to your workstation.
Best Practices for App Size Reduction
Reducing the app size is an ongoing process that extends beyond simply switching to the AAB format. Developers should adopt several strategies to keep the footprint small.
- Use ProGuard or R8 to remove unused code and obfuscate the remaining logic.
- Convert large images to WebP format, which offers better compression than PNG or JPEG.
- Audit external libraries to ensure they do not include unnecessary transitive dependencies.
- Utilize Lint tools to identify unused resources that can be safely deleted.
- Implement dynamic feature modules for functionality that is rarely used by the majority of your user base.
FAQ
How to check app size android app bundles?
You can use the Bundle Explorer in the Google Play Console to see the estimated download size for various device configurations. Alternatively, use the bundletool command line utility to generate a set of APKs from your AAB and calculate the total size for a specific device specification.
What is the difference between AAB and APK?
An APK is a ready to install package containing all resources for all devices. An AAB is a publishing format that Google Play uses to generate smaller, optimized APKs tailored to the specific hardware and language settings of each user who downloads the app.
How to implement dynamic delivery in Android?
Implementation requires organizing your project into Gradle feature modules. You must define these modules in your settings file and use the com.android.dynamic-feature plugin. You then use the Play Core library to request and install these modules at runtime when needed by the user.
Conclusion
Mastering the nuances of Android distribution is essential for modern mobile developers. By leveraging App Bundles and Dynamic Delivery, you provide a better experience for your users through faster downloads and reduced storage impact. As you refine your modular architecture, having a flexible workspace is invaluable. You can download Deska to start organizing your development environment with an infinite canvas and integrated AI tools. For more details on configuring your workspace for mobile builds, explore the getting started guide.