A new upload format, Android App Bundles, includes the app’s compiled code along with the resources. It defers the APK generation and signing the app to Google Play.
Dynamic Delivery, Google Play’s new app serving model, uses your app bundle to generate and serve optimized APK’s according to the device configuration of each user. Using this delivery methodology, users only download the code and resources they need to run your app. You are free from building, signing, and managing multiple APKs to support different devices. This also helps the users get the smaller and more optimized downloads.
You can also add the Dynamic Feature modules to your app project and have them included into your app bundle. The Dynamic Feature modules contain the assets and features that are not included when users download and install your app first time. Your app can later use the Play Core Library to download those modules as Dynamic Feature APKs. Thus through Dynamic Delivery mechanism, Google Play serves only the code and resources for that module to the device.
If you use Android Studio, you can build an Android App Bundle in just a few clicks. The app projects in Android Studio require little effort to support Dynamic Delivery. However, the Dynamic Feature modules are still in the beta stages and they might require a little extra effort and it might also require you to refactor your app.
Split APKs are the fundamental component of Dynamic Delivery which is available on Android 5.0 (API level 21) and higher versions. They are very similar to regular APKs, i.e., they include compiled DEX bytecode, resources, and an Android manifest. The Android platform treats the multiple installed split APKs as a single app. With split APKs, Google Play can break up a large app into smaller, discrete packages that are installed on a user’s device as required.
Split APKs are of three kinds:
- Base APK: This APK contains code and resources that all other split APKs can access and provides the basic functionality for your app. This is the first APK that’s installed when a user downloads your app.
- Configuration APKs: Each of these APKs includes native libraries and resources for a specific screen density, CPU architecture, or language. That way, when a device downloads a base or dynamic feature APK, it downloads only the libraries and resources it needs. For most app projects, you don’t need to refactor your app to support configuration APKs, Google Play generates them for you from the code and resources you include in your app bundle.
- Dynamic feature APKs: Each of these APKs contain code and resources that are not required when your app is first installed, but may be downloaded and installed later.
Image Source: https://developer.android.com/guide/app-bundle/
When you are using an Android App Bundle, Google Play generates and serves all of your app’s APKs. However, for devices running Android 4.4 (API level 20) or lower, Google Play serves a single APK that’s optimized for the device configuration. So whether you decide that your app will support devices running older Android versions or not, Dynamic Delivery will provide a flexible serving mechanism for you and your users.
Very little effort is required by most of the existing app projects to support Google Play’s new serving mechanism. That’s because the standard app module provides code and resources for your base APK and, with Android Studio, you can create dynamic features for your app in just a few clicks.
When you’re ready to add support for serving your app with Dynamic Delivery, read Configure your project for Dynamic Delivery.