SlideShare a Scribd company logo
1 of 11
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 speedReid Baker
 
Mobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & TestingMobile Day - Intel XDK & Testing
Mobile Day - Intel XDK & TestingSoftware 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 SpecAdam Paxton
 
Swagger in the API Lifecycle
Swagger in the API LifecycleSwagger in the API Lifecycle
Swagger in the API LifecycleOle 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 deenathayalanMuralidharan 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 NativeDavid Kay
 
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 DevOpsMuralidharan Deenathayalan
 
Capture the Cloud with Azure
Capture the Cloud with AzureCapture the Cloud with Azure
Capture the Cloud with AzureShahed Chowdhuri
 
Swagger - make your API accessible
Swagger - make your API accessibleSwagger - make your API accessible
Swagger - make your API accessibleVictor Trakhtenberg
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React NativeSambhu Lakshmanan
 
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 2016Adrian 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-RC2Shahed 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-animationModusJesus
 
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 IntroJulia Vi
 

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 androidzhang ghui
 
Build your android app with gradle
Build your android app with gradleBuild your android app with gradle
Build your android app with gradleSwain 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 projectShaka Huang
 
Head first android apps dev tools
Head first android apps dev toolsHead first android apps dev tools
Head first android apps dev toolsShaka Huang
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overviewKevin He
 
GR8CONF Contributing Back To Grails
GR8CONF Contributing Back To GrailsGR8CONF Contributing Back To Grails
GR8CONF Contributing Back To Grailsbobbywarner
 
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 combinationbrada
 
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 deliradioDroidcon 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
 
From Containerization to Modularity
From Containerization to ModularityFrom Containerization to Modularity
From Containerization to Modularityoasisfeng
 
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 AppsBruno Borges
 
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 combinationChris Ramsdale
 
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 copyChris Ramsdale
 
Visual Studio 2017 Release Notes
Visual Studio 2017 Release NotesVisual Studio 2017 Release Notes
Visual Studio 2017 Release NotesIan Philpot
 

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
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 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 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

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 

Recently uploaded (20)

Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 

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" } }