Publish smaller apps with the Android App Bundle

Jon Douglas

The Android App Bundle (.aab) is a new upload format that includes all of your app’s compiled code and resources, but defers APK generation and signing to Google Play at install time.

Google Play does this through a new app serving model called Dynamic Delivery, this uses your app bundle to generate and serve an optimized APK for each user’s unique device configuration, so they download only the code and resources that are needed to run the application.

This eliminates the need to have to build, sign, and manage multiple APKs based on their ABI, locale, screen size, and more. Additionally, you can use dynamic feature modules to define what feature modules and resources that users first download when they install your application.

Using Android App Bundles increases the app size limit to 150MB without having to use those pesky APK expansion files. One of the many benefits you get when using Android App Bundles.

Android App Bundle

Size Savings

As your application size increases, so does the complexity of your application. Your users may run into problems such as:

  • Slower downloads
  • Decreased installation rates
  • Increased uninstall rates
  • Non-supported device APKs

Instead, you can gain the benefits such as:

  • Faster downloads
  • Increased installation rates
  • Decreased uninstall rates
  • Serve users functionality and configurations on demand
  • Simplify your build and release management by removing the need to publish multiple APKs

If you’re curious on how this will impact your Android application today, check out these App Bundle Size Savings.

We wanted to see the benefits this would have on Xamarin, and to our surprise we saw some magnificent results!

Here we have an APK that was 39.4MB using a traditional upload to Google Play. After creating an Android App Bundle instead, we cut our app download size to 23.3MB! That’s a decrease of over 35%!

Creating an Android App Bundle cuts your app download size

Getting Started

To build app bundles and support Dynamic Delivery, you can follow these steps:

  1. Download Visual Studio 16.4 or higher on Windows or Visual Studio for Mac 8.4 or higher on Mac.
  2. Prepare your application for Release
  3. Build an Android App Bundle using Visual Studio. If you’re not using an IDE, you can instead build an app bundle from the command line.
  4. Enroll into app signing by Google Play
  5. Publish your app bundle to Google Play.

Build and deploy Android App Bundles

App bundles differ from APKs as they cannot be deployed directly to a device. Rather, it’s a format that is intended to be uploaded with all of your compiled code and resources. After you upload your signed app bundle, Google Play will have everything it needs to build and sign your application’s APKs and serve them to your users using Dynamic Delivery.

If you’re using Visual Studio, you can build your project as a signed app bundle in just a few clicks. If you’re not using the IDE, you can instead build an app bundle from the command line.

To enable support for Android App Bundles, you’ll need to opt-in to the bundle value of the Android Package Format property within your Android options. As you do this, ensure you change your project to a Release configuration as app bundles are intended for release packages only. To do this you can follow these steps:

  1. Right click your project, and select Properties.
  2. Navigate to Android Options.
  3. Change your configuration to Release.
  4. Change the Android Package Format to bundle.

Build and deploy Android App Bundles Image 1

After you’ve completed these steps, you can generate an app bundle by right clicking your project and selecting Archive. This will generate an app bundle for your application.

Build and deploy Android App Bundles Image 2

Test your app bundle

After you’ve created your Android App Bundle, you can test how Google Play will generate the respective APKs when deployed to a device. To test your app bundle, you may try to:

Learn More

For more detailed information on Android App Bundles, please see Google’s documentation on Android App Bundles.

Summary

With just a few clicks, you can upload your Android App Bundle to Google Play today and give your users the gift this holiday season of a smaller, optimized, dynamic APK for their devices!

Feedback

We encourage your feedback on any issues to be reported via the Report a Problem option found in your favorite IDE via Help > Report a Problem. If you have any questions regarding Android App Bundles, please post them on the Xamarin Forums or Stack Overflow.

4 comments

Discussion is closed. Login to edit/delete existing comments.

  • Brát Luboš 0

    Hello,

    we have bad experience with AAB. Yes, the size of the application is smaller, but dramaticaly increases startup time. Our .APK file startup time with Xamarin.Forms: 7s, but .AAB was 13s. It looks like .AAB destroys the AOT compiling.
    Any idea how to solve this problem?

    Thank you
    Lubos Brat

  • Robert Altland 0

    I got on board with Xamarin development because of their promise to be able to create anything with the platform that can be done natively. They delivered on that promise by making any features developed by either google or apple available very shortly after publishing. This aab feature is incomplete in Xamarin, and has been for at least 9 months. Xamarin supports android app bundles in the simplest case only, and leaves it to the developer to read the fine print to discover that instant apps and dynamic feature delivery are not implemented.

    • Wally McClure 0

      Unfortunately, that is how it has always been with software. They start supporting an initial feature, and over time, it gets better. I started on Xamarin in the first beta of their iOS Monotouch product in 2009, and it’s been that way since.

  • Afzal Syed 0

    Any update on how to implement dynamic feature module, i cant find any documentation to understand how it needs to be implemented in Xamarin. Thanks!

Feedback usabilla icon