Originally published at: https://gradle.org/training/gradle-for-android-training/
The Gradle For Android Training course is a half day, live, virtual instructor lead training class taught by an Android expert.
Course Summary
Google has chosen Gradle to be the foundation for the next-generation build system for Android apps, for use in the new Android Studio IDE and elsewhere. In this half-day presentation, we will give you a brief introduction to Gradle in general, before diving into the Gradle for Android plugin. You will learn how to set up Gradle scripts to build Android applications and libraries, to use as a foundation for further exploration of using Gradle for Android for your own projects.Duration
Half Day (3.5 Hours + 30 minutes Q&A)Objectives
Upon completion of this course you will get/learn…- A brief overview of Gradle, what it is for, and how to set it up
- How to create a Gradle build script, for an existing Eclipse/Ant project, or from scratch
- How to organize your code and resources for best use with Gradle for Android, so you can do different builds for different circumstances (debug/production, Play Store/other distribution channels, ARM/x86 CPU type, etc.)
- How to have your projects depend upon code from others, including how to integrate Maven artifacts into your Gradle builds
Audience
This course is designed for developers, architects, technical managers, and team leads looking to build their Android projects with Gradle, as well as experienced developers looking to jump-start their skills with Gradle.Prerequisites
Prior exposure to Android is preferredOutline
The proposed four-hour Gradle for Android course is divided into four hour-long segments, each providing time for some Q&A plus a short break before continuing into the next segment.Segment #1: Introducing Gradle for Android
- What? Why???
- A Quick Primer on Groovy Syntax
- The Gradle DSL
- Exporting an Eclipse Project
- Exploring the Exported build.gradle File
- The New Project Structure
- Gradle and Android Studio
Segment #2: Source Sets, Build Types, and Product Flavors
- Defining the Terms
- Source Sets: main/ and Beyond
- Augmenting the Stock Build Types
- Creating Your Own Build Type
- What is Configurable on a Build Type?
- Defining Some Product Flavors
- What is Configurable on a Product Flavor?
Segment #3: Dependencies
- Types of Dependencies
- Depending Upon a JAR
- Depending Upon Another Project
- Gradle and the Android Library Project
- Artifacts and Repositories
- Depending Upon Artifacts
- Publishing AARs as Artifacts
Segment #4: More Tips and Techniques
- Testing Android Applications
- Testing Android Library Projects
- Defining Custom Tasks
- Using Properties Files and Environment Variables
- Dynamic Configuration in build.gradle
- Gradle and Other Source Types [covers AIDL, NDK, and Renderscript]
- The Gradle Ecosystem