Android App bundle(.aab)

Gaurav Bansal
May 18, 2018 · 4 min read

A new app publishing format is available in 3.2 version to deploy customized apk to users using Google play’s dynamic delivery system.Studio will generate .aab file that will be uploaded on playstore and it will create many different versions of app based on chip architecture, screen size and locale. Newer customized apk for different devices have smaller download size.(We can still do these things using app split and some configuration changes in gradle, but now play console and studio will do these task automatically for you).

Image for post
Image for post
App bundle

App bundle is a publishing format it can’t be directly install on device.It also contains some metadata files that will not be present in final apk;
It will also enable dynamic feature to be included in app for specific devices using on demand installation.

Android App bundle will enable two feature in android app development.

  • Dynamic delivery system
  • Modular App development

In this article we will discuss about dynamic delivery system only.

Before discussing These feature first we will discuss what is inside .aab zip archive.

What is inside .aab-

Image for post
Image for post
.aab file structure

resources.pb(protocol buffer format) is resource table file equivalent of resources.arac in apk. assets.pb and native.pb are equivalent of resource table for assets and native library.
resource table ,asset table and native libraries table describe the targeting of the files of your app.File targeting is the description of what type of device or user a given file is targeted for.Play console use these tables to create multiple customized apk.

Assets targeting- app bundle also allows assets targeting, currently only Language targeting is supported.Texture compression and Graphic Api version for openGL will also be added in future.
Example- How to use assets targeting in below pic.

Image for post
Image for post
How to use assets targeting

Dynamic Delivery System-

The following describes the three kinds of split APKs, and figure 1 below illustrates the relationship of these APKs for a simple and more complex app.

  • 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.
Image for post
Image for post
Split apks
  • Configuration APKs: Each of these APKs include 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.

Size savings by Dynamic delivery system-
On an average app published with app bundles are 20% smaller in size.

Image for post
Image for post
Size savings by app bundle

App having multiple language supports and native libraries will get maximum advantage from this.
Note: If Every app switch to app bundle we are going to save 10PB data per day from app downloads and upgrade.

How to build app bundle-
To make app bundle in Android studio 3.2 inside build menu tab and additional build bundle menu item is available.We can configure bundle file.

Image for post
Image for post
App bundle configurations

That’s all about dynamic delivery using android app bundle.So let’s wait for Android studio 3.2 and save user data(both device data and network data).

Happy coding!!!
Checkout following articles about android development.

MindOrks

Our community publishes stories worth reading on Android…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store