This document discusses Gradle and its use in Android Studio. It begins with defining Gradle as a build language, dependency manager, and task scheduler that uses Groovy for a build-by-convention approach. It then notes how Gradle makes it easy to create Android projects with multiple modules and build types/flavors in Android Studio. The rest of the document demonstrates Gradle's project structure and basics, use of plugins and tasks, and how to set up multi-module, build type, and flavor configurations to build different variants of an Android app in Gradle and Android Studio.
Why Teams call analytics are critical to your entire business
Gradle and Android Studio : Best of Friends
1. PRESENTED BY: ROMIN IRANI | DECEMBER 14, 2014
Gradle : Your Friend in Android Studio
2. Agenda
What is Gradle ?
Gradle Features
Gradle & Android Studio
Demo : Understanding Gradle in Android
Studio
2
3. Gradle is ….
Build Language
Dependency Resolver and Manager
Build Task scheduler and executor
Build by Convention
Groovy DSL
Multi-Project Builds
Custom Logic
API and Plugin ecosystem
And definitions like that scare the developer in
3
4. Gradle actually is …
Your friend in Android Studio
Makes it easy to create Android Projects that can handle multiple
modules (app , library, APIs)
Allows you to use a single Android Project to develop versions for
Production
Demo
Based on simple declarative and easy to express language
Can be run from both command line and inside Android Studio
And other goodies …
Maybe … this is beginning to make more sense.
4
5. Android Developers – Wake up !
2 IDEs
Difficult to support both for Google
Official Note does mention that work
is happening on Android Studio only !
Simply Import Eclipse projects or
Export to Gradle
5
13. Multi Module Projects
13
• settings.gradle at Root
• Each folder at root is a module
• build.gradle in each module
• specific plugins
• mention Dependencies
• Example : Android + Cloud Module
15. Product Flavors
Allows you to build multiple variants of the same application
demo
full
For e.g. 2 Config Types and 2 Flavors = 4 combinations
demoRelease
demoDebug
fullRelease
fullDebug
Apply separate resources
Apply separate source files
15