Slide 1

Slide 1 text

Android App Bundle: from start to deployment Julien Salvi

Slide 2

Slide 2 text

Julien Salvi Android GDE PAUG, Punk and IPAs! Lead Android Engineer @ Aircall @JulienSalvi

Slide 3

Slide 3 text

Table of contents What’s Android App Bundle? Ship small, move fast Moving to Android App Bundle From Gradle build scripts to CI/CD Handling testing with AAB How to manage your testing sessions with AAB with bundletool Advanced AAB features A glimpse at Asset Delivery and Dynamic Features

Slide 4

Slide 4 text

What’s Android App Bundle? Ship small, move fast

Slide 5

Slide 5 text

Android App Bundle Optimizing the APK size and deliver what the user only needs are the key features of Android App Bundle. Let’s see what AAB brings to us and for our users πŸš€

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Android App Bundle What does it bring? ● New publication format introduced by Google β›“ ● Produce a aab file instead of apk 🧰 ● Allow to distribute smaller apk to users πŸ“¦ ● Enable Play Feature and Assets Delivery πŸš€ ● Have a positive impact 🌱

Slide 8

Slide 8 text

Android App Bundle Let’s have a look at the APK?

Slide 9

Slide 9 text

Android App Bundle What about the .aab? Key advantages: πŸ’₯ Decrease APK size by 21 MB (-59%) for common devices πŸ’₯ Less download time for our users πŸ’₯ We save (a little bit) the planet

Slide 10

Slide 10 text

MAD Score at your service

Slide 11

Slide 11 text

Trusted by many companies

Slide 12

Slide 12 text

Do I need to migrate to AAB right now? Well... ● It’s not mandatory for old apps but it has many benefits! ● If you’re distributing your app outside the Play Store, maybe no ● Yes! And actually you must go for the AAB format... ● Since August 2021, AAB is mandatory for new apps in Play Store For the new apps...

Slide 13

Slide 13 text

Moving to Android App Bundle From Gradle build scripts to the CI/CD

Slide 14

Slide 14 text

Journey to App Bundle Update codebase Update CI/CD Deploy on Play Store Play Feature/ Asset Delivery ✨

Slide 15

Slide 15 text

Android App Bundle Gradle configuration app:bundleRelease Gradle task:

Slide 16

Slide 16 text

CI/CD with CircleCI and fastlane ✍ Installing fastlane is very easy on CircleCI πŸš€ Run the playstore fastlane lane (wait for the next slide :) CircleCI setup:

Slide 17

Slide 17 text

CI/CD with CircleCI and fastlane ✍ Sign the .aab file with your production key πŸš€ Release to the Play Store with fastlane ⚠ Make sure to enable App Signing on the Play Console Fastlane setup:

Slide 18

Slide 18 text

App Bundle on the Play Console

Slide 19

Slide 19 text

Handling testing with App Bundle How to manage testing sessions with AAB with bundletool

Slide 20

Slide 20 text

Handling testing with App Bundle How to test .aab files? ● You cannot directly install .aab files on a device ● Use the test track on the Play Console ● Use Firebase App Distribution ● Use bundletool for converting .aab file into .apk files Convert .aab to .apk files

Slide 21

Slide 21 text

Handling testing with App Bundle Discovering bundletool

Slide 22

Slide 22 text

Live Demo πŸš€ (Wish me luck…)

Slide 23

Slide 23 text

bundletool x CI/CD

Slide 24

Slide 24 text

Bundletool with the CI/CD Install bundletool with Docker

Slide 25

Slide 25 text

Bundletool with the CI/CD Install bundletool

Slide 26

Slide 26 text

Bundletool with the CI/CD Bundletool with GitlabCI

Slide 27

Slide 27 text

Advanced ABB features A glimpse at Asset Delivery and Dynamic Features

Slide 28

Slide 28 text

What kind of features with App Bundle? Asset Delivery: ● Great for games mainly: allow downloading large assets after install ● You can configure when and how the asset download happens ● Deliver features to your users so they have always optimized apps ● Full modularization of your application Dynamic Features:

Slide 29

Slide 29 text

Asset Delivery

Slide 30

Slide 30 text

Asset Delivery Delivery mode ● install-time: the assets are delivered when the app is installed. No download needed. Served as split APKs. ● fast-follow: assets are downloaded automatically when app is installed. ● on-demand: assets are downloaded when the app is running.

Slide 31

Slide 31 text

Asset Delivery Download size limits β„Ή APK limit size: 100 MB, AAB limit size 150 MB on the Play Store ● Each fast-follow and on-demand asset pack has a limit of 512 MB. ● install-time asset packs cannot exceed 1 GB. ● All asset packs cannot exceed 2 GB on the device. ● No more than 50 asset packs per App Bundle.

Slide 32

Slide 32 text

Asset Delivery Configuration ● Make sure to target version 4.0.0+ for your Android Gradle plugin my-project/ β”œβ”€β”€ app/ β”œβ”€β”€ asset-pack-name/ β”‚ β”œβ”€β”€ src/ β”‚ β”‚ └── main/ β”‚ β”‚ └── assets/ β”‚ β”‚ └── β”‚ └── build.gradle β”œβ”€β”€ build.gradle └── settings.gradle

Slide 33

Slide 33 text

Asset Delivery Configuration

Slide 34

Slide 34 text

source: https://developer.android.com/guide/playcore/asset-delivery/integrate-java#integrate-play-asset-delivery

Slide 35

Slide 35 text

Asset Delivery Asset delivery library

Slide 36

Slide 36 text

Asset Delivery install-time asset packs

Slide 37

Slide 37 text

Asset Delivery on-demand/fast-follow asset packs

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Dynamic Features

Slide 40

Slide 40 text

Dynamic Features Overview ● Allow to give only the needed features to your users ● Delivery modes: install-time, conditional or on-demand ● Make sure to notify your users about the download states ● Do not forget to uninstall unused modules πŸ‘€ Let’s have a quick look how we can setup a dynamic feature

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

Dynamic feature Configuration Do not include any signing config, minifyEnabled property or version name/code.

Slide 43

Slide 43 text

Dynamic feature Manifest configuration: install-time

Slide 44

Slide 44 text

Dynamic feature Manifest configuration: conditional

Slide 45

Slide 45 text

Dynamic feature Spotlight on on-demand feature

Slide 46

Slide 46 text

Dynamic feature Spotlight on on-demand feature

Slide 47

Slide 47 text

Android App Bundle ● Reducing APK file size ● Use Dynamic Features and Assets Delivery ● Have a positive impact ● AAB files cannot be directly installed on devices ● You are stuck with the Play Store ecosystem The Good The Bad

Slide 48

Slide 48 text

Aircall Journey to Android App Bundle https://medium.com/inside-aircall/14d0df0d0ea7

Slide 49

Slide 49 text

Make good use of App Bundle! πŸ“¦ Do you have any questions? @JulienSalvi Thanks Julien Salvi Lead Android Engineer @ Aircall