SlideShare ist ein Scribd-Unternehmen logo
1 von 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"
}
}

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 

Kürzlich hochgeladen (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 

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