SlideShare a Scribd company logo
Dependency-Aware Build
Variants in Android Studio 3.0
Stefan Martynkiw
Android Studio 3.0 Introduction
• Introduced at Google I/O 2017
• Improvements:
• Faster Gradle build times
• Profiling tools
• UI
• Network Request Inspection (with Retrofit & OkHTTP)
• Device File Explorer
• App-Private files too! (no more adb run-as!)
• Android Gradle Plugin Improvements
Application Structure and Dependencies
• Applications in Android Studio
can be structured into modules
• Drivewyze Example:
• Agatha (Mobile app)
• Gaby (Stripped down for Android
ELDs)
• Erica (Stripped down for even
older Android ELDs)
• Common
• “Magic Sauce”
Agatha Erica Gaby
Common
Why have variants?
• Production
• Signing Keys, Production
Environment
• QA
• Unsigned, QA test environment
• Development
• Unsigned, Local-host server
Agatha Erica Gaby
Common
Set Theory and the Cross Product
• {A, B, C}
• {A, B, C} ⋈ {D, E, F} =
• AD, AE, AF
• BD, BE, BF
• CD, CE, CF
• {A, B, C} ⋈ {D, E, F} ⋈ {Y, Z} =
• ADY, AEY, AFY
• BDY, BEY, BFY
• CDY, CEY, CFY
• ADZ, AEZ, AFZ
• BDZ, BEZ BFZ
• CDZ, CEZ, CFZ
Abstract  Real
• “Build type”:
• {Debug, Release, Simulated
Location}
• “Authorization Service / Server
Environment”:
• {Production, QA, Local}
• “Event cache”:
• {Production, QA, Local}
Product Flavors & Build Types & Build Variants
• Build Types
• Sets up various build properties.
• The debug build type enables debug options and signs
the APK with the debug key.
• The release build type may shrink, obfuscate, and sign
your APK with a release key for distribution.
• Android Studio creates the debug and release build
types by default.
• Product Flavors
• Product flavors represent different versions of your app
that you may release to users
• Free and paid versions of your app.
• You can customize product flavors to use different code
and resources, while sharing and reusing the parts that
are common to all versions of your app.
• Product flavors are optional and you must create them
manually.
• More info:
• https://developer.android.com/studio/build/index.html
• Build Variants
• The resulting entries in the set formed by cross-product
of BuildTypes x ProductFlavors
freeFlavor paidFlavor
debug freeDebug paidDebug
release freeRelease paidRelease
The Old Way
• “Build Type” did not propagate
to dependent modules
• Really old bug in Gradle
• Reported March, 2013
• https://issuetracker.google.com/issu
es/36967265
• “DESCRIPTION:
Gradle plugin does not propagate
whether you are doing a debug
build or a release build to a
dependent android library”
Agatha Build.conf:
buildTypes {
release {…}
debug {…}
simloc {…}
}
productFlavors {
prodFlavor {…}
qaFlavor {…}
devFlavor {…}
}
Dependencies{ …
simlocCompile project(path: ':common', configuration: 'simlocMongoQa')
debugCompile project(path: ':common', configuration: 'libraryMongoQa')
releaseCompile project(path: ':common', configuration: 'libraryMongoProd')}
Common Build.conf:
buildTypes {
mongoDev { … }
mongoQa { … }
mongoProd { … }
}
productFlavors {
library {
buildConfigField 'boolean', 'SIMLOC_BUILD', "false"
}
simloc {
buildConfigField 'boolean', 'SIMLOC_BUILD', "true"
}
}
Flavor Dimensions
• Flavor Dimensions add another
cross product.
• {A, B, C} ⋈ {D, E, F} ⋈ {Y, Z} =
• ADY, AEY, AFY
• BDY, BEY, BFY
• CDY, CEY, CFY
• ADZ, AEZ, AFZ
• BDZ, BEZ BFZ
• CDZ, CEZ, CFZ
• https://www.youtube.com/watc
h?v=daYl7edb6S0
Declaring Flavor Dimensions
• //Todo finish slide:
• https://developer.android.com/s
tudio/build/build-
variants.html#flavor-dimensions
The New Way Common: Build.conf
buildTypes {
debug{
debuggable true
buildConfigField 'boolean', 'SIMLOC_BUILD', "false"
}
release {
debuggable false
buildConfigField 'boolean', 'SIMLOC_BUILD', "false"
}
simloc {
debuggable true
buildConfigField 'boolean', 'SIMLOC_BUILD', "true"
}
}
flavorDimensions "mongo"
productFlavors {
mongoDevFlavor {
dimension "mongo"
buildConfigField 'String', 'DRIVE_EVENTREPL_URI', '”…"'
}
mongoQaFlavor {
dimension "mongo"
buildConfigField 'String', 'DRIVE_EVENTREPL_URI', '”…"'
}
mongoProdFlavor {
dimension "mongo"
buildConfigField 'String', 'DRIVE_EVENTREPL_URI', '"…"'
}
}
Agatha2: Build.conf
flavorDimensions "dsp", "mongo"
productFlavors {
prodFlavor {
dimension "dsp"
applicationId 'com.drivewyze.agatha2'
…
}
qaFlavor {
dimension "dsp"
applicationId 'com.drivewyze.agatha2.qa'
…
}
devFlavor {
dimension "dsp"
applicationId 'com.drivewyze.agatha2.dev'
…
}
mongoDevFlavor {
dimension "mongo"
}
mongoQaFlavor {
dimension "mongo"
}
mongoProdFlavor {
dimension "mongo"
}
}

More Related Content

What's hot

Android studio&Gradle&Autotest
Android studio&Gradle&AutotestAndroid studio&Gradle&Autotest
Android studio&Gradle&Autotest
毅 方
 
Intro to Gradle + How to get up to speed
Intro to Gradle + How to get up to speedIntro to Gradle + How to get up to speed
Intro to Gradle + How to get up to speed
Reid Baker
 
Mobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & TestingMobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & Testing
Software Guru
 
Get Your Node.js API Swaggering with OpenAPI Spec
Get Your Node.js API Swaggering with OpenAPI SpecGet Your Node.js API Swaggering with OpenAPI Spec
Get Your Node.js API Swaggering with OpenAPI Spec
Adam Paxton
 
Swagger in the API Lifecycle
Swagger in the API LifecycleSwagger in the API Lifecycle
Swagger in the API Lifecycle
Ole Lensmar
 
Android Studio vs Eclipse: What are the main differences?
Android Studio vs Eclipse: What are the main differences?Android Studio vs Eclipse: What are the main differences?
Android Studio vs Eclipse: What are the main differences?
avocarrot
 
What's new in .net 5 by muralidharan deenathayalan
What's new in .net 5 by muralidharan deenathayalanWhat's new in .net 5 by muralidharan deenathayalan
What's new in .net 5 by muralidharan deenathayalan
Muralidharan Deenathayalan
 
Drag and Drop UI Development with React Native
Drag and Drop UI Development with React NativeDrag and Drop UI Development with React Native
Drag and Drop UI Development with React Native
David Kay
 
React Native
React NativeReact Native
React Native
Fatih Şimşek
 
Getting started with package management - Azure DevOps
Getting started with package management - Azure DevOpsGetting started with package management - Azure DevOps
Getting started with package management - Azure DevOps
Muralidharan Deenathayalan
 
Capture the Cloud with Azure
Capture the Cloud with AzureCapture the Cloud with Azure
Capture the Cloud with Azure
Shahed Chowdhuri
 
Swagger - make your API accessible
Swagger - make your API accessibleSwagger - make your API accessible
Swagger - make your API accessible
Victor Trakhtenberg
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Sambhu Lakshmanan
 
Android studio
Android studioAndroid studio
Android studio
Paresh Mayani
 
Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016
Adrian Philipp
 
ASP.NET Core 1.0 Overview: Post-RC2
ASP.NET Core 1.0 Overview: Post-RC2ASP.NET Core 1.0 Overview: Post-RC2
ASP.NET Core 1.0 Overview: Post-RC2
Shahed Chowdhuri
 
Optimizing React Native views for pre-animation
Optimizing React Native views for pre-animationOptimizing React Native views for pre-animation
Optimizing React Native views for pre-animation
ModusJesus
 
A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)
Oursky
 
React Native Intro
React Native IntroReact Native Intro
React Native Intro
Julia Vi
 
Docs Like Code
Docs Like CodeDocs Like Code
Docs Like Code
Anne Gentle
 

What's hot (20)

Android studio&Gradle&Autotest
Android studio&Gradle&AutotestAndroid studio&Gradle&Autotest
Android studio&Gradle&Autotest
 
Intro to Gradle + How to get up to speed
Intro to Gradle + How to get up to speedIntro to Gradle + How to get up to speed
Intro to Gradle + How to get up to speed
 
Mobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & TestingMobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & Testing
 
Get Your Node.js API Swaggering with OpenAPI Spec
Get Your Node.js API Swaggering with OpenAPI SpecGet Your Node.js API Swaggering with OpenAPI Spec
Get Your Node.js API Swaggering with OpenAPI Spec
 
Swagger in the API Lifecycle
Swagger in the API LifecycleSwagger in the API Lifecycle
Swagger in the API Lifecycle
 
Android Studio vs Eclipse: What are the main differences?
Android Studio vs Eclipse: What are the main differences?Android Studio vs Eclipse: What are the main differences?
Android Studio vs Eclipse: What are the main differences?
 
What's new in .net 5 by muralidharan deenathayalan
What's new in .net 5 by muralidharan deenathayalanWhat's new in .net 5 by muralidharan deenathayalan
What's new in .net 5 by muralidharan deenathayalan
 
Drag and Drop UI Development with React Native
Drag and Drop UI Development with React NativeDrag and Drop UI Development with React Native
Drag and Drop UI Development with React Native
 
React Native
React NativeReact Native
React Native
 
Getting started with package management - Azure DevOps
Getting started with package management - Azure DevOpsGetting started with package management - Azure DevOps
Getting started with package management - Azure DevOps
 
Capture the Cloud with Azure
Capture the Cloud with AzureCapture the Cloud with Azure
Capture the Cloud with Azure
 
Swagger - make your API accessible
Swagger - make your API accessibleSwagger - make your API accessible
Swagger - make your API accessible
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Android studio
Android studioAndroid studio
Android studio
 
Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016
 
ASP.NET Core 1.0 Overview: Post-RC2
ASP.NET Core 1.0 Overview: Post-RC2ASP.NET Core 1.0 Overview: Post-RC2
ASP.NET Core 1.0 Overview: Post-RC2
 
Optimizing React Native views for pre-animation
Optimizing React Native views for pre-animationOptimizing React Native views for pre-animation
Optimizing React Native views for pre-animation
 
A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)A guide to hiring a great developer to build your first app (redacted version)
A guide to hiring a great developer to build your first app (redacted version)
 
React Native Intro
React Native IntroReact Native Intro
React Native Intro
 
Docs Like Code
Docs Like CodeDocs Like Code
Docs Like Code
 

Similar to Android Studio 3 - Dependency-Aware Build Variants and Product Flavors

Gradle,the new build system for android
Gradle,the new build system for androidGradle,the new build system for android
Gradle,the new build system for android
zhang ghui
 
Build your android app with gradle
Build your android app with gradleBuild your android app with gradle
Build your android app with gradle
Swain Loda
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!
Édipo Souza
 
Gradle enabled android project
Gradle enabled android projectGradle enabled android project
Gradle enabled android project
Shaka Huang
 
Gradle build capabilities
Gradle build capabilities Gradle build capabilities
Gradle build capabilities
Zeinab Mohamed Abdelmawla
 
Head first android apps dev tools
Head first android apps dev toolsHead first android apps dev tools
Head first android apps dev tools
Shaka Huang
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overview
Kevin He
 
GR8CONF Contributing Back To Grails
GR8CONF Contributing Back To GrailsGR8CONF Contributing Back To Grails
GR8CONF Contributing Back To Grails
bobbywarner
 
android_android + app engine- a developer's dream combination
android_android + app engine- a developer's dream combinationandroid_android + app engine- a developer's dream combination
android_android + app engine- a developer's dream combination
brada
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradio
Droidcon Berlin
 
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Daniel Gallego Vico
 
Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...
BizTalk360
 
Gradle 101
Gradle 101Gradle 101
Gradle 101
Kurt Mbanje
 
From Containerization to Modularity
From Containerization to ModularityFrom Containerization to Modularity
From Containerization to Modularity
oasisfeng
 
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX AppsFrom GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
Bruno Borges
 
Android android + app engine a developer's dream combination copy
Android android + app engine  a developer's dream combination copyAndroid android + app engine  a developer's dream combination copy
Android android + app engine a developer's dream combination copy
Chris Ramsdale
 
Android android + app engine a developer's dream combination
Android android + app engine  a developer's dream combinationAndroid android + app engine  a developer's dream combination
Android android + app engine a developer's dream combination
Chris Ramsdale
 
Android studio
Android studioAndroid studio
Android studio
Željko Plesac
 
Visual Studio 2017 Release Notes
Visual Studio 2017 Release NotesVisual Studio 2017 Release Notes
Visual Studio 2017 Release Notes
Ian Philpot
 
GitHub for partners
GitHub for partnersGitHub for partners
GitHub for partners
Lorenzo Barbieri
 

Similar to Android Studio 3 - Dependency-Aware Build Variants and Product Flavors (20)

Gradle,the new build system for android
Gradle,the new build system for androidGradle,the new build system for android
Gradle,the new build system for android
 
Build your android app with gradle
Build your android app with gradleBuild your android app with gradle
Build your android app with gradle
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!
 
Gradle enabled android project
Gradle enabled android projectGradle enabled android project
Gradle enabled android project
 
Gradle build capabilities
Gradle build capabilities Gradle build capabilities
Gradle build capabilities
 
Head first android apps dev tools
Head first android apps dev toolsHead first android apps dev tools
Head first android apps dev tools
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overview
 
GR8CONF Contributing Back To Grails
GR8CONF Contributing Back To GrailsGR8CONF Contributing Back To Grails
GR8CONF Contributing Back To Grails
 
android_android + app engine- a developer's dream combination
android_android + app engine- a developer's dream combinationandroid_android + app engine- a developer's dream combination
android_android + app engine- a developer's dream combination
 
Froyo to kit kat two years developing & maintaining deliradio
Froyo to kit kat   two years developing & maintaining deliradioFroyo to kit kat   two years developing & maintaining deliradio
Froyo to kit kat two years developing & maintaining deliradio
 
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
 
Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...Azure Integration DTAP Series, How to go from Development to Production – Par...
Azure Integration DTAP Series, How to go from Development to Production – Par...
 
Gradle 101
Gradle 101Gradle 101
Gradle 101
 
From Containerization to Modularity
From Containerization to ModularityFrom Containerization to Modularity
From Containerization to Modularity
 
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX AppsFrom GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
 
Android android + app engine a developer's dream combination copy
Android android + app engine  a developer's dream combination copyAndroid android + app engine  a developer's dream combination copy
Android android + app engine a developer's dream combination copy
 
Android android + app engine a developer's dream combination
Android android + app engine  a developer's dream combinationAndroid android + app engine  a developer's dream combination
Android android + app engine a developer's dream combination
 
Android studio
Android studioAndroid studio
Android studio
 
Visual Studio 2017 Release Notes
Visual Studio 2017 Release NotesVisual Studio 2017 Release Notes
Visual Studio 2017 Release Notes
 
GitHub for partners
GitHub for partnersGitHub for partners
GitHub for partners
 

Recently uploaded

The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
kalichargn70th171
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
OnePlan Solutions
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
Jhone kinadey
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
narinav14
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
campbellclarkson
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 

Recently uploaded (20)

The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
Boost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management AppsBoost Your Savings with These Money Management Apps
Boost Your Savings with These Money Management Apps
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 

Android Studio 3 - Dependency-Aware Build Variants and Product Flavors

  • 1. Dependency-Aware Build Variants in Android Studio 3.0 Stefan Martynkiw
  • 2. Android Studio 3.0 Introduction • Introduced at Google I/O 2017 • Improvements: • Faster Gradle build times • Profiling tools • UI • Network Request Inspection (with Retrofit & OkHTTP) • Device File Explorer • App-Private files too! (no more adb run-as!) • Android Gradle Plugin Improvements
  • 3. Application Structure and Dependencies • Applications in Android Studio can be structured into modules • Drivewyze Example: • Agatha (Mobile app) • Gaby (Stripped down for Android ELDs) • Erica (Stripped down for even older Android ELDs) • Common • “Magic Sauce” Agatha Erica Gaby Common
  • 4. Why have variants? • Production • Signing Keys, Production Environment • QA • Unsigned, QA test environment • Development • Unsigned, Local-host server Agatha Erica Gaby Common
  • 5. Set Theory and the Cross Product • {A, B, C} • {A, B, C} ⋈ {D, E, F} = • AD, AE, AF • BD, BE, BF • CD, CE, CF • {A, B, C} ⋈ {D, E, F} ⋈ {Y, Z} = • ADY, AEY, AFY • BDY, BEY, BFY • CDY, CEY, CFY • ADZ, AEZ, AFZ • BDZ, BEZ BFZ • CDZ, CEZ, CFZ
  • 6. Abstract  Real • “Build type”: • {Debug, Release, Simulated Location} • “Authorization Service / Server Environment”: • {Production, QA, Local} • “Event cache”: • {Production, QA, Local}
  • 7. Product Flavors & Build Types & Build Variants • Build Types • Sets up various build properties. • The debug build type enables debug options and signs the APK with the debug key. • The release build type may shrink, obfuscate, and sign your APK with a release key for distribution. • Android Studio creates the debug and release build types by default. • Product Flavors • Product flavors represent different versions of your app that you may release to users • Free and paid versions of your app. • You can customize product flavors to use different code and resources, while sharing and reusing the parts that are common to all versions of your app. • Product flavors are optional and you must create them manually. • More info: • https://developer.android.com/studio/build/index.html • Build Variants • The resulting entries in the set formed by cross-product of BuildTypes x ProductFlavors freeFlavor paidFlavor debug freeDebug paidDebug release freeRelease paidRelease
  • 8. The Old Way • “Build Type” did not propagate to dependent modules • Really old bug in Gradle • Reported March, 2013 • https://issuetracker.google.com/issu es/36967265 • “DESCRIPTION: Gradle plugin does not propagate whether you are doing a debug build or a release build to a dependent android library” Agatha Build.conf: buildTypes { release {…} debug {…} simloc {…} } productFlavors { prodFlavor {…} qaFlavor {…} devFlavor {…} } Dependencies{ … simlocCompile project(path: ':common', configuration: 'simlocMongoQa') debugCompile project(path: ':common', configuration: 'libraryMongoQa') releaseCompile project(path: ':common', configuration: 'libraryMongoProd')} Common Build.conf: buildTypes { mongoDev { … } mongoQa { … } mongoProd { … } } productFlavors { library { buildConfigField 'boolean', 'SIMLOC_BUILD', "false" } simloc { buildConfigField 'boolean', 'SIMLOC_BUILD', "true" } }
  • 9. Flavor Dimensions • Flavor Dimensions add another cross product. • {A, B, C} ⋈ {D, E, F} ⋈ {Y, Z} = • ADY, AEY, AFY • BDY, BEY, BFY • CDY, CEY, CFY • ADZ, AEZ, AFZ • BDZ, BEZ BFZ • CDZ, CEZ, CFZ • https://www.youtube.com/watc h?v=daYl7edb6S0
  • 10. Declaring Flavor Dimensions • //Todo finish slide: • https://developer.android.com/s tudio/build/build- variants.html#flavor-dimensions
  • 11. The New Way Common: Build.conf buildTypes { debug{ debuggable true buildConfigField 'boolean', 'SIMLOC_BUILD', "false" } release { debuggable false buildConfigField 'boolean', 'SIMLOC_BUILD', "false" } simloc { debuggable true buildConfigField 'boolean', 'SIMLOC_BUILD', "true" } } flavorDimensions "mongo" productFlavors { mongoDevFlavor { dimension "mongo" buildConfigField 'String', 'DRIVE_EVENTREPL_URI', '”…"' } mongoQaFlavor { dimension "mongo" buildConfigField 'String', 'DRIVE_EVENTREPL_URI', '”…"' } mongoProdFlavor { dimension "mongo" buildConfigField 'String', 'DRIVE_EVENTREPL_URI', '"…"' } } Agatha2: Build.conf flavorDimensions "dsp", "mongo" productFlavors { prodFlavor { dimension "dsp" applicationId 'com.drivewyze.agatha2' … } qaFlavor { dimension "dsp" applicationId 'com.drivewyze.agatha2.qa' … } devFlavor { dimension "dsp" applicationId 'com.drivewyze.agatha2.dev' … } mongoDevFlavor { dimension "mongo" } mongoQaFlavor { dimension "mongo" } mongoProdFlavor { dimension "mongo" } }