Gradle For Android Training

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 preferred

Outline

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

  1. What? Why???
  2. A Quick Primer on Groovy Syntax
  3. The Gradle DSL
  4. Exporting an Eclipse Project
  5. Exploring the Exported build.gradle File
  6. The New Project Structure
  7. Gradle and Android Studio

Segment #2: Source Sets, Build Types, and Product Flavors

  1. Defining the Terms
  2. Source Sets: main/ and Beyond
  3. Augmenting the Stock Build Types
  4. Creating Your Own Build Type
  5. What is Configurable on a Build Type?
  6. Defining Some Product Flavors
  7. What is Configurable on a Product Flavor?

Segment #3: Dependencies

  1. Types of Dependencies
  2. Depending Upon a JAR
  3. Depending Upon Another Project
  4. Gradle and the Android Library Project
  5. Artifacts and Repositories
  6. Depending Upon Artifacts
  7. Publishing AARs as Artifacts

Segment #4: More Tips and Techniques

  1. Testing Android Applications
  2. Testing Android Library Projects
  3. Defining Custom Tasks
  4. Using Properties Files and Environment Variables
  5. Dynamic Configuration in build.gradle
  6. Gradle and Other Source Types [covers AIDL, NDK, and Renderscript]
  7. The Gradle Ecosystem