SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Build your Android App with Gradle
Android new build system
Agenda
• What is Gradle
• Getting started with gradle
• Use cases
• Q&A
Download Meetup Sample Code
– http://goo.gl/qoXAfa
What is gradle
• Gradle is a JVM based project build automation tool that
builds upon the concepts of Apache Ant and Apache
Maven and introduces a Groovy based domain-specific-
language (DSL) instead of the more traditional XML form of
declaring the project configuration.
Installation
• Download the latest android plugin supported Gradle version
• Extract the downloaded zip “gradle-1.10-all.zip” to any
directory
• Configure the GRADLE_HOME environment variable
• set GRADLE_HOME=<installed directoy>gradle-1.10
• set PATH=%PATH%%GRADLE_HOME%bin
• C:> gradle
Gradle Task
• C:> gradle tasks
• Applying the plugin’s to the build file will automatically add set of
build task to run
• assemble
The task to assemble the output(s) of the project
• check
The task to run all the checks.
• build
This task does both assemble and check
• clean
This task cleans the output of the project
Build File Skeleton
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
}
}
apply plugin: 'android'
android {
buildToolsVersion "19.0.1"
compileSdkVersion 19
}
Gradle Wrapper
• C:> gradle wrapper
task wrapper(type: Wrapper) {
gradleVersion = '1.10‘
}
/
└── gradlew
└── gradlew.bat
└── gradle
└── wrapper
└── gradle-wrapper.jar
└── gradle-wrapper.properties
Convention Over Configuration
src
└── main
l └── java
l
└── instrumentTest
└── java
sourceSets {
main{
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
Usecase : 1
I have project with multiple library projects, one of which is
required to be shared with one of my colleague who's working
in a another project.
Dependency Management
• dependencies DSL element is part of the standard Gradle
• Can add dependencies on local and remote libraries
• To add a dependency have to provide library on the compile
configuration under dependencies DSL
• Everything added to the compile configuration get packaged in
to the final APK
• Gradle will follow all dependencies transitively
Dependencies On Multiple Projects
• Each projects will have its own build.gradle declaring how it
gets built
• There will be a file called settings.gradle at the root, which
define which folder is a Gradle project
• If there are more than one library, importing order should be
considered on dependencies on each other
Publish Library To Artifact Repo
• Publish artifacts to local artifact repository
Maven Central
● Proper release and
snapshot release
management
Usecase :2
• I want to make a digitally signed and secured release
version of my app
Build types
• This is achieved by buildTypes DSL
• By default, the android plugin automatically sets up the
project to build both a debug and a release version of the
application
• Difference is that the ability to enable debug and how the APK
is signed
• It allows to customize both debug and release versions, as
well as creating other build types
Build Types…
• Build Types can contribute to the build with code and
resources.
• For each Build Type, a new matching sourceSet is created,
under src directory
src/<buildtypename>/
• This means the Build Type names cannot be main or
instrumentTest
Signing APK
• Android system will not install or run an application that is not
signed appropriately.
• To sign an APK have to make use of signingConfigs DSL
Obfuscating
• Tool ProGuard is used automatically to obfuscate the APK
• It will rename classes, fields, and methods with semantically
obscure names to make it difficult to reverse engineer.
• Android plugin support proguard version is 4.10
• ProGuard will shrinks, optimizes, and remove unused code
which will result smaller APK
Usecase : 3
• I want to make a free version of my application with less
features and commercial version with all features.
Build Variants
– Different versions of the same application or Same
application packaged differently or combination of both.
• Have to occupy productFlavors DSL
• Build Type + Product Flavor = Build Variant
• Product flavor will generate APK’s for all possible
combinations of Build Types and Product Flavors
Debug Release
Free Free-Debug Free-Release
Commercial Commercial-Debug Commercial-Release
Usecase : 4
I want to unit test my project with a testing framework,
Testing
• No need to have a separate test project any more it is
integrated to the application project
• Default location for the instrument test cases are located in
src/instrumentTest
• Test APK is built to test the app under test using the Android
instrumentation framework
• No need to have a AndroidManifest.xml for the app, cause it
will get generated automatically
• Test app manifest is automatically get filled with the package
name and the instrument test runner
Usecase : 5
• I want to measure the quality of my source code continuously
with some quality tools by Integrate it with a Continuous
Integration System
Q&A
Thank you

Weitere ähnliche Inhalte

Was ist angesagt?

QConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous IntegrationQConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
Rodrigo Russo
 
2015 05-06-karsten gaebert-akademie-etrainings
2015 05-06-karsten gaebert-akademie-etrainings2015 05-06-karsten gaebert-akademie-etrainings
2015 05-06-karsten gaebert-akademie-etrainings
Haufe-Lexware GmbH & Co KG
 
A Reference Architecture to Enable Visibility and Traceability across the Ent...
A Reference Architecture to Enable Visibility and Traceability across the Ent...A Reference Architecture to Enable Visibility and Traceability across the Ent...
A Reference Architecture to Enable Visibility and Traceability across the Ent...
CollabNet
 
Lessons learned: Choosing your documentation system
Lessons learned: Choosing your documentation systemLessons learned: Choosing your documentation system
Lessons learned: Choosing your documentation system
Pronovix
 

Was ist angesagt? (20)

Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
QConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous IntegrationQConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
QConSP 2014 - Continuous Delivery - Part 03 - Continuous Integration
 
Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016
 
2015 05-06-karsten gaebert-akademie-etrainings
2015 05-06-karsten gaebert-akademie-etrainings2015 05-06-karsten gaebert-akademie-etrainings
2015 05-06-karsten gaebert-akademie-etrainings
 
Git slides
Git slidesGit slides
Git slides
 
Building a Secure Supply Chain with Docker
Building a Secure Supply Chain with DockerBuilding a Secure Supply Chain with Docker
Building a Secure Supply Chain with Docker
 
SkyBase - a Devops Platform for Hybrid Cloud
SkyBase - a Devops Platform for Hybrid CloudSkyBase - a Devops Platform for Hybrid Cloud
SkyBase - a Devops Platform for Hybrid Cloud
 
13 practical tips for writing secure golang applications
13 practical tips for writing secure golang applications13 practical tips for writing secure golang applications
13 practical tips for writing secure golang applications
 
Agnostic Continuous Delivery
Agnostic Continuous DeliveryAgnostic Continuous Delivery
Agnostic Continuous Delivery
 
Learn Continuous Integration with Jenkins All in One Guide
Learn Continuous Integration with Jenkins All in One GuideLearn Continuous Integration with Jenkins All in One Guide
Learn Continuous Integration with Jenkins All in One Guide
 
Selenium Testing your Kubernetes Apps with Machine Learning and Testim
Selenium Testing your Kubernetes Apps with Machine Learning and TestimSelenium Testing your Kubernetes Apps with Machine Learning and Testim
Selenium Testing your Kubernetes Apps with Machine Learning and Testim
 
A Reference Architecture to Enable Visibility and Traceability across the Ent...
A Reference Architecture to Enable Visibility and Traceability across the Ent...A Reference Architecture to Enable Visibility and Traceability across the Ent...
A Reference Architecture to Enable Visibility and Traceability across the Ent...
 
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
CI CD Pipeline Using Jenkins | Continuous Integration and Deployment | DevOps...
 
Microservices Testing at Scale
Microservices Testing at ScaleMicroservices Testing at Scale
Microservices Testing at Scale
 
Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...
Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...
Cloud Native Testing, 2020 Edition: A Modern Blueprint for Pre-production Tes...
 
GitHub as a Landing Page
GitHub as a Landing Page GitHub as a Landing Page
GitHub as a Landing Page
 
From Continuous Integration to DevOps
From Continuous Integration to DevOpsFrom Continuous Integration to DevOps
From Continuous Integration to DevOps
 
Designing and Debugging Mobile Apps with an Embedded, Scriptable Web Server
Designing and Debugging Mobile Apps with an Embedded, Scriptable Web ServerDesigning and Debugging Mobile Apps with an Embedded, Scriptable Web Server
Designing and Debugging Mobile Apps with an Embedded, Scriptable Web Server
 
Lessons learned: Choosing your documentation system
Lessons learned: Choosing your documentation systemLessons learned: Choosing your documentation system
Lessons learned: Choosing your documentation system
 
Gerrit linuxtag2011
Gerrit linuxtag2011Gerrit linuxtag2011
Gerrit linuxtag2011
 

Andere mochten auch

updated as on 17May 2016 Resume
updated as on 17May 2016 Resumeupdated as on 17May 2016 Resume
updated as on 17May 2016 Resume
S.K. JHA
 

Andere mochten auch (15)

Presentation on collaboration
Presentation on collaborationPresentation on collaboration
Presentation on collaboration
 
CV
CVCV
CV
 
updated as on 17May 2016 Resume
updated as on 17May 2016 Resumeupdated as on 17May 2016 Resume
updated as on 17May 2016 Resume
 
Resume Linkin
Resume LinkinResume Linkin
Resume Linkin
 
Póster tour grupal a china julio 2016
Póster tour grupal a china julio 2016Póster tour grupal a china julio 2016
Póster tour grupal a china julio 2016
 
Natysoc05
Natysoc05Natysoc05
Natysoc05
 
Social media a gyakorlatban prezentáció
Social media a gyakorlatban prezentációSocial media a gyakorlatban prezentáció
Social media a gyakorlatban prezentáció
 
Phoenix Perry - Maker Assembly
Phoenix Perry - Maker AssemblyPhoenix Perry - Maker Assembly
Phoenix Perry - Maker Assembly
 
Dependency Management on iOS
Dependency Management on iOSDependency Management on iOS
Dependency Management on iOS
 
How to Develop and Deploy Web-Scale Applications on AWS
How to Develop and Deploy Web-Scale Applications on AWSHow to Develop and Deploy Web-Scale Applications on AWS
How to Develop and Deploy Web-Scale Applications on AWS
 
Understanding clinical data exchange and cda (hl7 201)
Understanding clinical data exchange and cda (hl7 201)Understanding clinical data exchange and cda (hl7 201)
Understanding clinical data exchange and cda (hl7 201)
 
Multithreading on iOS
Multithreading on iOSMultithreading on iOS
Multithreading on iOS
 
FUNDAMENTOS DE LAS HERRAMIENTAS WEB 2.0
FUNDAMENTOS DE LAS HERRAMIENTAS WEB 2.0FUNDAMENTOS DE LAS HERRAMIENTAS WEB 2.0
FUNDAMENTOS DE LAS HERRAMIENTAS WEB 2.0
 
branding and design in B2B companies
branding and design in B2B companiesbranding and design in B2B companies
branding and design in B2B companies
 
Understanding Generation Z - Presented at the HR Leader Talk with Hery Kustan...
Understanding Generation Z - Presented at the HR Leader Talk with Hery Kustan...Understanding Generation Z - Presented at the HR Leader Talk with Hery Kustan...
Understanding Generation Z - Presented at the HR Leader Talk with Hery Kustan...
 

Ähnlich wie Build your android app with gradle

Ähnlich wie Build your android app with gradle (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
 
Exploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & BeyondExploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & Beyond
 
Android Studio 3 - Dependency-Aware Build Variants and Product Flavors
Android Studio 3 - Dependency-Aware Build Variants and Product FlavorsAndroid Studio 3 - Dependency-Aware Build Variants and Product Flavors
Android Studio 3 - Dependency-Aware Build Variants and Product Flavors
 
Developing for Android-Types of Android Application
Developing for Android-Types of Android ApplicationDeveloping for Android-Types of Android Application
Developing for Android-Types of Android Application
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
 
Gradle build capabilities
Gradle build capabilities Gradle build capabilities
Gradle build capabilities
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 
7 maven vsgradle
7 maven vsgradle7 maven vsgradle
7 maven vsgradle
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Gradle enabled android project
Gradle enabled android projectGradle enabled android project
Gradle enabled android project
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Gocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous DeploymentGocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous Deployment
 
Using Grunt with Drupal
Using Grunt with DrupalUsing Grunt with Drupal
Using Grunt with Drupal
 
DevOps on GCP Course Compared to AWS
DevOps on GCP Course Compared to AWSDevOps on GCP Course Compared to AWS
DevOps on GCP Course Compared to AWS
 
Devops
DevopsDevops
Devops
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!
 
Introduction to gradle
Introduction to gradleIntroduction to gradle
Introduction to gradle
 
Introduction to angular | Concepts and Environment setup
Introduction to angular | Concepts and Environment setupIntroduction to angular | Concepts and Environment setup
Introduction to angular | Concepts and Environment setup
 
CICD with SharePoint SPFx A useful overview
CICD with SharePoint SPFx A useful overviewCICD with SharePoint SPFx A useful overview
CICD with SharePoint SPFx A useful overview
 
Using and extending Alfresco Content Application
Using and extending Alfresco Content ApplicationUsing and extending Alfresco Content Application
Using and extending Alfresco Content Application
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Build your android app with gradle

  • 1. Build your Android App with Gradle Android new build system
  • 2. Agenda • What is Gradle • Getting started with gradle • Use cases • Q&A
  • 3. Download Meetup Sample Code – http://goo.gl/qoXAfa
  • 4. What is gradle • Gradle is a JVM based project build automation tool that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy based domain-specific- language (DSL) instead of the more traditional XML form of declaring the project configuration.
  • 5. Installation • Download the latest android plugin supported Gradle version • Extract the downloaded zip “gradle-1.10-all.zip” to any directory • Configure the GRADLE_HOME environment variable • set GRADLE_HOME=<installed directoy>gradle-1.10 • set PATH=%PATH%%GRADLE_HOME%bin • C:> gradle
  • 6. Gradle Task • C:> gradle tasks • Applying the plugin’s to the build file will automatically add set of build task to run • assemble The task to assemble the output(s) of the project • check The task to run all the checks. • build This task does both assemble and check • clean This task cleans the output of the project
  • 7. Build File Skeleton buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.8.+' } } apply plugin: 'android' android { buildToolsVersion "19.0.1" compileSdkVersion 19 }
  • 8. Gradle Wrapper • C:> gradle wrapper task wrapper(type: Wrapper) { gradleVersion = '1.10‘ } / └── gradlew └── gradlew.bat └── gradle └── wrapper └── gradle-wrapper.jar └── gradle-wrapper.properties
  • 9. Convention Over Configuration src └── main l └── java l └── instrumentTest └── java sourceSets { main{ manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } instrumentTest.setRoot('tests') }
  • 10. Usecase : 1 I have project with multiple library projects, one of which is required to be shared with one of my colleague who's working in a another project.
  • 11. Dependency Management • dependencies DSL element is part of the standard Gradle • Can add dependencies on local and remote libraries • To add a dependency have to provide library on the compile configuration under dependencies DSL • Everything added to the compile configuration get packaged in to the final APK • Gradle will follow all dependencies transitively
  • 12. Dependencies On Multiple Projects • Each projects will have its own build.gradle declaring how it gets built • There will be a file called settings.gradle at the root, which define which folder is a Gradle project • If there are more than one library, importing order should be considered on dependencies on each other
  • 13. Publish Library To Artifact Repo • Publish artifacts to local artifact repository Maven Central ● Proper release and snapshot release management
  • 14. Usecase :2 • I want to make a digitally signed and secured release version of my app
  • 15. Build types • This is achieved by buildTypes DSL • By default, the android plugin automatically sets up the project to build both a debug and a release version of the application • Difference is that the ability to enable debug and how the APK is signed • It allows to customize both debug and release versions, as well as creating other build types
  • 16. Build Types… • Build Types can contribute to the build with code and resources. • For each Build Type, a new matching sourceSet is created, under src directory src/<buildtypename>/ • This means the Build Type names cannot be main or instrumentTest
  • 17. Signing APK • Android system will not install or run an application that is not signed appropriately. • To sign an APK have to make use of signingConfigs DSL
  • 18. Obfuscating • Tool ProGuard is used automatically to obfuscate the APK • It will rename classes, fields, and methods with semantically obscure names to make it difficult to reverse engineer. • Android plugin support proguard version is 4.10 • ProGuard will shrinks, optimizes, and remove unused code which will result smaller APK
  • 19. Usecase : 3 • I want to make a free version of my application with less features and commercial version with all features.
  • 20. Build Variants – Different versions of the same application or Same application packaged differently or combination of both. • Have to occupy productFlavors DSL • Build Type + Product Flavor = Build Variant • Product flavor will generate APK’s for all possible combinations of Build Types and Product Flavors Debug Release Free Free-Debug Free-Release Commercial Commercial-Debug Commercial-Release
  • 21. Usecase : 4 I want to unit test my project with a testing framework,
  • 22. Testing • No need to have a separate test project any more it is integrated to the application project • Default location for the instrument test cases are located in src/instrumentTest • Test APK is built to test the app under test using the Android instrumentation framework • No need to have a AndroidManifest.xml for the app, cause it will get generated automatically • Test app manifest is automatically get filled with the package name and the instrument test runner
  • 23. Usecase : 5 • I want to measure the quality of my source code continuously with some quality tools by Integrate it with a Continuous Integration System
  • 24. Q&A