SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Android App Bundles
Syed Awais Mazher
May 07, 2021
- What is Android App Bundle?
- AAB ≠ APK
- .aab file structure
- Advantages
- Dynamic Delivery
- Modular App Development
- Dynamic Feature Module
- Reduced application size
- Code Walkthrough
- Limitations 😣
.aab file structure
.aab file structure
assets/<name>#<key>_<value>/...
Where <key> is one of
{ lang, tcf, opengl, vulkan }
base/
manifest/
AndroidManifest.xml
dex/
Classes.dex
res/
drawable/..
values-fr/
assets/..
lib/
armeabi-v7a/..
Dynamic Delivery
& modularization
Split APK’s
● Base APK
● Configuration APKs
● Dynamic feature APKs
Dynamic Delivery
Split APKs
Dynamic Delivery
Split APKs
Split APKs
Objective
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua.
Dynamic Delivery
modularization
Reduced APK Size
On average
35%
size reduced
Code Walkthrough
● Google Play Core Library
● Play Feature Delivery
○ Install-time delivery
○ Conditional delivery
○ On-demand delivery
■ Best Practices
● Play Asset Delivery
Dependency wheel
Create a DFM
Create a DFM
Create a DFM
Configuration of install time module
Configuration of install time module
Configuration of install time module
Configuration of conditional module
This allow you to set certain device configuration requirements for feature
modules to be downloaded automatically during app install.
If a device does not meet all the requirements you specify, the module is not
downloaded at app install-time. . However, you can still request feature for
installation later.
on-demand delivery
- SplitInstallManagerFactory
- SplitInstallRequest Builder
- Monitoring request state
- State updates
- Pending, Requires_User_Confirmation,
- Downloading, Downloaded,
- Installing, Installed
- Failed, Canceling, Canceled
- Downloading progress
- Manage Installed modules
- Access Modules by enabling SplitCompat
- Access Components using reflection
- Local testing of DFM modules.
on-demand delivery
best practices
Asset Delivery
Module will be installed in a same way as we did in on-demand module approach. After
successful installation, we will get assets as following.
Local Testing
- Build an app Bundle using Android Studio Plugin, (in wizard)
- Use bundletool to generate a set of APKs
- passing --local-testing flag
- Device configurations .e.g.
bundletool build-apks --bundle=/Users/joebirch/releases/sample.aab --
output=/Users/bell/releases/sample.apks
--ks=/Users/bell/some_keystore.jks
--ks-pass=file:/Users/bell/some_keystore.pwd
--ks-key-alias=SomeAlias
--key-pass=file:/Users/bell/some_key.pwd
Limitations
Though App Bundle is compatible with Pro-Guard, but we are facing some
issue with Dex-Guard.
Still need to look into this vertical.
If you have any experience with Dex-Guard, please get in touch for further
analyses.
Q&A
If you joined late or I fast forwarded, feel free to get in touch at
https://www.linkedin.com/in/awaismazharbukhari/
I Would love to hear your thoughts.
References
● https://developer.android.com/guide/playcore
● Exploring the Android App Bundle

Weitere ähnliche Inhalte

Was ist angesagt?

App Engine/GWT overview (STLIC 02-10)
App Engine/GWT overview (STLIC 02-10)App Engine/GWT overview (STLIC 02-10)
App Engine/GWT overview (STLIC 02-10)
jasonacooper
 

Was ist angesagt? (20)

Adobe AEM core components
Adobe AEM core componentsAdobe AEM core components
Adobe AEM core components
 
App Engine/GWT overview (STLIC 02-10)
App Engine/GWT overview (STLIC 02-10)App Engine/GWT overview (STLIC 02-10)
App Engine/GWT overview (STLIC 02-10)
 
IVY: an overview
IVY: an overviewIVY: an overview
IVY: an overview
 
IMMERSE'16 Introduction to adobe experience manager back end
IMMERSE'16 Introduction to adobe experience manager back endIMMERSE'16 Introduction to adobe experience manager back end
IMMERSE'16 Introduction to adobe experience manager back end
 
Hybrid Apps, Ionic framework
Hybrid Apps, Ionic frameworkHybrid Apps, Ionic framework
Hybrid Apps, Ionic framework
 
Angular Universal
Angular UniversalAngular Universal
Angular Universal
 
Angular 9 New features
Angular 9 New featuresAngular 9 New features
Angular 9 New features
 
CIRCUIT 2015 - Hybrid App Development with AEM Apps
CIRCUIT 2015 - Hybrid App Development with AEM AppsCIRCUIT 2015 - Hybrid App Development with AEM Apps
CIRCUIT 2015 - Hybrid App Development with AEM Apps
 
Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps
 
What's New in Titanium 1.5
What's New in Titanium 1.5What's New in Titanium 1.5
What's New in Titanium 1.5
 
IMMERSE'16 Introduction to AEM Tooling
IMMERSE'16 Introduction to AEM ToolingIMMERSE'16 Introduction to AEM Tooling
IMMERSE'16 Introduction to AEM Tooling
 
EVOLVE'16 | Deploy | Varun Mitra | Introduction to AEM based e-commerce
EVOLVE'16 | Deploy | Varun Mitra | Introduction to AEM based e-commerceEVOLVE'16 | Deploy | Varun Mitra | Introduction to AEM based e-commerce
EVOLVE'16 | Deploy | Varun Mitra | Introduction to AEM based e-commerce
 
WordCamp Bucharest 2017
WordCamp Bucharest 2017WordCamp Bucharest 2017
WordCamp Bucharest 2017
 
EVOLVE'16 | Maximize | Thanesh Sadachcharan | AEM 6.2 - What is in it for you?
EVOLVE'16 | Maximize | Thanesh Sadachcharan | AEM 6.2 - What is in it for you?EVOLVE'16 | Maximize | Thanesh Sadachcharan | AEM 6.2 - What is in it for you?
EVOLVE'16 | Maximize | Thanesh Sadachcharan | AEM 6.2 - What is in it for you?
 
Introduction to Codenvy / JugSummerCamp 2014
Introduction to Codenvy / JugSummerCamp 2014Introduction to Codenvy / JugSummerCamp 2014
Introduction to Codenvy / JugSummerCamp 2014
 
Sample google app engine applications
Sample google app engine applicationsSample google app engine applications
Sample google app engine applications
 
Jenkins users meetup plugins overview
Jenkins users meetup plugins overviewJenkins users meetup plugins overview
Jenkins users meetup plugins overview
 
EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM
EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEMEVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM
EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM
 
Mobile automation using selenium cucumber & appium
Mobile automation using selenium cucumber & appiumMobile automation using selenium cucumber & appium
Mobile automation using selenium cucumber & appium
 
Ask the AEM Community Expert Feb 2016 Session: AEM + Brackets
Ask the AEM Community Expert Feb 2016 Session: AEM + BracketsAsk the AEM Community Expert Feb 2016 Session: AEM + Brackets
Ask the AEM Community Expert Feb 2016 Session: AEM + Brackets
 

Ähnlich wie Android App Bundles - Overview

Multi modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.jsMulti modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.js
David Amend
 

Ähnlich wie Android App Bundles - Overview (20)

Android pentesting the hackers-meetup
Android pentesting the hackers-meetupAndroid pentesting the hackers-meetup
Android pentesting the hackers-meetup
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in Mule
 
Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...Configuration Management and Transforming Legacy Applications in the Enterpri...
Configuration Management and Transforming Legacy Applications in the Enterpri...
 
Tutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopTutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer Workshop
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
Oracle 12c Launch Event 02 ADF 12c and Maven in Jdeveloper / By Aino Andriessen
 
Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
 
Multi modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.jsMulti modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.js
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
 
Developing for Android-Types of Android Application
Developing for Android-Types of Android ApplicationDeveloping for Android-Types of Android Application
Developing for Android-Types of Android Application
 
Android Application WebAPI Development Training
Android Application WebAPI Development TrainingAndroid Application WebAPI Development Training
Android Application WebAPI Development Training
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
以 Kotlin 快速打造 Mobile Backend
以 Kotlin 快速打造 Mobile Backend以 Kotlin 快速打造 Mobile Backend
以 Kotlin 快速打造 Mobile Backend
 
Android Penetration testing - Day 2
 Android Penetration testing - Day 2 Android Penetration testing - Day 2
Android Penetration testing - Day 2
 
Building JavaScript
Building JavaScriptBuilding JavaScript
Building JavaScript
 
Training in Android with Maven
Training in Android with MavenTraining in Android with Maven
Training in Android with Maven
 

Mehr von Syed Awais Mazhar Bukhari

Mehr von Syed Awais Mazhar Bukhari (6)

CDD - Atomic Design Methodology
CDD - Atomic Design MethodologyCDD - Atomic Design Methodology
CDD - Atomic Design Methodology
 
Introduction to Kotlin - Android KTX
Introduction to Kotlin - Android KTXIntroduction to Kotlin - Android KTX
Introduction to Kotlin - Android KTX
 
Intro to Rx Java
Intro to Rx JavaIntro to Rx Java
Intro to Rx Java
 
Insight into java 1.8, OOP VS FP
Insight into java 1.8, OOP VS FPInsight into java 1.8, OOP VS FP
Insight into java 1.8, OOP VS FP
 
Methods of data recovery
Methods of data recoveryMethods of data recovery
Methods of data recovery
 
Introduction to triggers
Introduction to triggersIntroduction to triggers
Introduction to triggers
 

Kürzlich hochgeladen

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Kürzlich hochgeladen (20)

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 

Android App Bundles - Overview

Hinweis der Redaktion

  1. Biggest problem now a days is large application size, which eventually takes a lot of space and slow down phones. Which results to more uninstallation. Android App Bundle is a new app publishing format in playstore, which help devs to optimize the size of apk. An APK is something that we can serve directly to our users devices, whereas on the other hand an App Bundle is a publishing format that cannot be installed onto a device on it’s own. Whilst they do have their similarities, the app bundle does contain some content which we will not find within our APKs. For example, the meta data files within the bundles are used by tooling to build the APKs that will be served to our users — these files are then not included in the APKs themselves. Whilst most of the content within the app bundle you will likely already be familiar with, let’s take a look at what a typical app bundle might contain: No more Multi APKs Previously, we used to build multiple APKs and manage different versions and the process was so messy and NOT Efficient.
  2. An APK is something that we can serve directly to our users devices, whereas on the other hand an App Bundle is a publishing format that cannot be installed onto a device on it’s own. Whilst they do have their similarities, the app bundle does contain some content which we will not find within our APKs. For example, the meta data files within the bundles are used by tooling to build the APKs that will be served to our users — these files are then not included in the APKs themselves. Whilst most of the content within the app bundle you will likely already be familiar with, let’s take a look at what a typical app bundle might contain:
  3. Almost similar to APK manifest.xml — Just like you will find in your APKs, there is a manifest file present per app bundle. However, unlike the APK these are not stored in a binary format — it is compiled into protocol buffer format which makes it easier for tooling to transform when required. res / assets / libs — All resources, assets and native libraries are stored the same way as in an APK. The only difference here is that any resource files will also be stored in the protocol buffer format as the last point. resources.pb — Similar to the resource.arac file which can be found inside of our current APK files, the resources.pb file is a resource table which states the resources and specifics for targeting which are present inside of our app. The .pb extension is due to the protocol buffer format which is used by tooling to transform the app bundle before it is converted into the binary format used within the APK. assets.pb — This is the equivalent of a resource table for application assets and will only be present if you are using assets in your application. native.pb — This is the equivalent of a resource table for native libraries and will only be present if you are using native libraries in your application.
  4. 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. 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.
  5. bundle { language { enableSplit = false } density { enableSplit = true } abi { enableSplit = true } }
  6. What is Play Core? The Play Core Library is your app’s runtime interface with the Google Play Store. Some of the things you can do with Play Core include the following: Download additional language resources Manage delivery of feature modules Manage delivery of asset packs Trigger in-app updates Request in-app reviews
  7. In the standard project structure that uses libraries, the base com.android.application module depends on com.android.library modules, which means you can use any classes defined in the library from the base module freely. With DFMs however, the base com.android.application is a dependency of com.android.dynamic-feature modules, which means you can use any classes defined in the base module and its libraries in the DFM, but you can’t reference any code defined in the DFM from the base application at compile time. Once the APKs produced by the DFM are installed with your application (regardless of the delivery mechanism: install-time, on-demand or conditional), their code is available to the ClassLoader at runtime.
  8. Conditional delivery options are not supported for instant-enabled feature modules. <dist:country dist:code="CN"/> <dist:min/max-sdk dist:value="21"/>
  9. Access base code from a module Code that is inside your base module can be used directly by other modules. You don't need to do anything special; just import and use the classes you need. Access module code from another module An object or class inside a module cannot be statically accessed from another module directly, but it can be accessed indirectly, using reflection. You should be wary of how often this happens, due to the performance costs of reflection. For complex use cases, go for DI i.e. Dagger 2 to guarantee a single reflection call per application lifetime. To simplify the interactions with the object after instantiation, it is recommended to define an interface in the base module and its implementation in the feature module. For instance:
  10. Perform download and install in the background Free up device storage when a module is no longer needed Advanced tips Anticipate a user's need for a feature in the current session/ ahead of installation based on hardware, country etc.
  11. Access base code from a module Code that is inside your base module can be used directly by other modules. You don't need to do anything special; just import and use the classes you need. Access module code from another module An object or class inside a module cannot be statically accessed from another module directly, but it can be accessed indirectly, using reflection. You should be wary of how often this happens, due to the performance costs of reflection. For complex use cases, go for DI i.e. Dagger 2 to guarantee a single reflection call per application lifetime. To simplify the interactions with the object after instantiation, it is recommended to define an interface in the base module and its implementation in the feature module. For instance: