The Android app bundle was announced at Google I/O 2018 as a new publishing format for Android apps to be deployed via the Google Play Store; bringing with it smaller app sizes and more dynamic delivery. The package is an alternative to deploying your app using the APK.
The APK
An APK is like a zip file but with the file extension APK, produced from the build process. It contains compiled code, resources, native libraries and anything else required to install your app onto a device. It is uploaded to the Google Play Store where users can download and install it onto their devices.
The APK does a great job, but as apps grow larger and users install more apps on their devices the limits of the APK format become obvious. Users have to download resources for all different device configurations to their own, like images for different device resolutions or language strings for different languages. This means excessive download sizes for users who may not have unlimited data plans or WiFi connections to download the app.
The Android App Bundle
Luckily, Google have produced a solution to this challenge – the Android App Bundle. Rather than building a monolithic APK containing all the code for an app, we now build a bundle containing all code for the Guardian Live app. This bundle is in a format that will allow the Google Play Store to split it into smaller APKs based on screen density, language or device architecture. This means the Google Play Store only provides a user device with the relevant APKs, saving data and space on a device.
The video below, from the Android Dev summit in 2018, summarises some of the benefits of the Android App bundle – bigger apps lose acquisitions and the best way to increase app downloads is by reducing the size of your app.
Our experience
Converting the Guardian Live app from APK format to using the Android App Bundle was an extremely straightforward process. Using the bundle has reduced the size of our app from 15.7 mb to 11.1 mb a whopping saving of 23%. That’s less than the average savings of 35% mentioned by Google. Needless to say, we are really pleased with the result.
Updating our build process was a breeze, we changed our assemble** gradle tasks to their equivalent bundle** task. We used fastlane to upload our artefacts to the Google Play Store and to update that process we just had to change an argument to the supply command. You can view the documentation for this here.
After releasing the Android App Bundle to the Google Play store we saw some users experience crashes because of missing resources. We were concerned we might have made a mistake, until we realised it was due to users who were sideloading the incorrect APKs for their device. The Android Developers website has a helpful list of known issues. You can refer to this list if you run into any issues during the process of releasing an Android App Bundle. If you haven’t yet made the jump to using the bundle we can’t recommend the format enough.