Slide 1

Slide 1 text

Diving Into Android App Bundles DROIDCON KENYA 2019 AUGUST 8TH-9TH, 2019

Slide 2

Slide 2 text

DROIDCON KENYA 2019 AUGUST 8TH-9TH, 2019 @_larikraun Omolara Adejuwon Android Engineer at Kudi Inc.

Slide 3

Slide 3 text

Storage Space Many phones have storage less than 1GB available space Your app + Photos +Videos + Chats + Other apps =

Slide 4

Slide 4 text

Time Large Apps Slower downloads Frustrated Users

Slide 5

Slide 5 text

Cost Many users live on capped data. The larger the app, the less willing people are to download

Slide 6

Slide 6 text

Key Insights 1% 3MB =

Slide 7

Slide 7 text

ANALYZING APK classes.dex classes2.dex assets/ res/ AndroidManifest.xml

Slide 8

Slide 8 text

Screen density xxxhdpi xxhdpi xhdpi hdpi mdpi ldpi Architecture arm64 x86 arm x86_64 Locale en xh db ja ... ...

Slide 9

Slide 9 text

Android App Bundles

Slide 10

Slide 10 text

Replaces the traditional monolithic apk

Slide 11

Slide 11 text

Single artifact with all of your app's code and resources

Slide 12

Slide 12 text

Play generates the apk optimized for specific devices. Therefore, AABs are not installable directly.

Slide 13

Slide 13 text

20% average size saving vs universal APK 11% increase in installs due to size savings

Slide 14

Slide 14 text

7.2% saved in App Size At Kudi

Slide 15

Slide 15 text

ANALYZING AAB base/ dex/ classes.dex classes2.dex assets/ res/ manifest/ AndroidManifest.xml

Slide 16

Slide 16 text

Dynamic Feature Modules

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

AndroidManifest.xml

Slide 21

Slide 21 text

droidconke/ dex/ classes.dex assets/ res/ manifest/ AndroidManifest.xml base/ dex/ classes.dex classes2.dex assets/ res/ manifest/ AndroidManifest.xml Base Module Dynamic Feature Module - droidconke

Slide 22

Slide 22 text

Dynamic Delivery

Slide 23

Slide 23 text

The smaller APKs are achieved by delivering only the resources the specific devices need.

Slide 24

Slide 24 text

It works with Split APKs as the underlying principle

Slide 25

Slide 25 text

Split APKs Base APK: contains all common code and resources Configuration APKs: contains resources based on device’s config i.e locale, architecture, screen density Dynamic Feature APKs: contains codes that can be downloaded at a later time. This will be discussed later in the presentation. - Introduced in Lollipop

Slide 26

Slide 26 text

Screen density xxxhdpi xxhdpi xhdpi hdpi mdpi ldpi Architecture arm64 x86 arm x86_64 Locale en xh db ja fr ...

Slide 27

Slide 27 text

Screen density xxhdpi xhdpi hdpi mdpi ldpi Architecture arm64 x86 arm x86_64 Locale en xh db ja fr ... xxxhdpi

Slide 28

Slide 28 text

Screen density xxhdpi xhdpi hdpi mdpi ldpi Architecture x86 arm x86_64 Locale en xh db ja fr ... arm64 xxxhdpi

Slide 29

Slide 29 text

Screen density xxhdpi xhdpi hdpi mdpi ldpi Architecture x86 arm x86_64 Locale xh db ja ... fr arm64 xxxhdpi

Slide 30

Slide 30 text

In-App Updates

Slide 31

Slide 31 text

Play Core library feature that introduces a new request flow to prompt active users to update your app

Slide 32

Slide 32 text

Works only with devices running Android 5.0 (API level 21) or higher,

Slide 33

Slide 33 text

A user experience that provides background download and installation with graceful state monitoring. This UX is appropriate when it’s acceptable for the user to use the app while downloading the update. Flexible In-App Updates

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

A full screen user experience that requires the user to update and restart the app in order to continue using the app. Immediate In-App Updates

Slide 36

Slide 36 text

This UX is best for cases where an update is critical for continued use of the app. After a user accepts an immediate update, Google Play handles the update installation and app restart. Immediate In-App Updates

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Is update available?

Slide 40

Slide 40 text

Start the update

Slide 41

Slide 41 text

Start the update

Slide 42

Slide 42 text

For flexible updates, you need to handle the app installation yourself after the download is complete. Flexible Vs. Immediate In-App Updates For immediate updates, play handles the download and installation for you.

Slide 43

Slide 43 text

Install the downloaded updated

Slide 44

Slide 44 text

Conditional Delivery

Slide 45

Slide 45 text

Let's you control which part of your app is served to which users

Slide 46

Slide 46 text

You can specify conditions under which a feature would be delivered as part of the app installation or otherwise left out.

Slide 47

Slide 47 text

Types of Conditions Country MinSdk Version Device Feature

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

On-Demand Delivery

Slide 50

Slide 50 text

Let's you install and uninstall specific features in on-demand

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

AndroidManifest.xml

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

To be able to maximize all the cool features of Android App Bundles as explained so far, your app needs to be well modularized. Moyinoluwa Adeyemi just delivered a great talk on App Modularization: From Zero to Hero

Slide 57

Slide 57 text

Testing Android App Bundles

Slide 58

Slide 58 text

Unlike APKs, AABs are not installable directly because play generates the apk optimized for specific devices

Slide 59

Slide 59 text

Internal App Sharing

Slide 60

Slide 60 text

Internal App Sharing gives you a quick and easy way to share Android App Bundle and Apk Internally

Slide 61

Slide 61 text

It lets you upload app bundle or APK and share the link with your team.

Slide 62

Slide 62 text

No signed APK or App bundle is required for Internal app sharing.

Slide 63

Slide 63 text

No Unique Version code enforcement. So multiple APK or App bundles can be upload independently, to the play console.

Slide 64

Slide 64 text

You can also debug the APK or App bundles once they’re installed to the tester’s device by uploading Debuggable artifacts.

Slide 65

Slide 65 text

There are APIs available for Internal App sharing so you can automate some of the processes

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

Image Credit: https://medium.com/mindorks/internal-app-sharing-in-android-f80c7751bf37

Slide 68

Slide 68 text

A Challenge we faced at Kudi

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

https://developer.android.com/studio/projects/dynamic-delivery https://developer.android.com/studio/command-line/bundletool https://events.google.com/io/schedule/?section=may-8&sid=b9eabde0-be05- 492c-bf9e-c3f772f1db7e https://codelabs.developers.google.com/codelabs/your-first-dynamic- app/index.html Useful Links

Slide 72

Slide 72 text

Thank you for listening @_larikraun Omolara Adejuwon