Book Image

Gradle for Android

By : Kevin Pelgrims
Book Image

Gradle for Android

By: Kevin Pelgrims

Overview of this book

Table of Contents (16 chapters)
Gradle for Android
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Dependency concepts


There are a few dependency-related concepts that are interesting to understand, even if you might not need to use them today. One of them is the concept of configurations, which explains the compile keyword that we have been using for dependencies throughout this chapter.

Configurations

Sometimes you might have to work with an SDK that is only present on certain devices, like a Bluetooth SDK from a specific vendor, for example. In order to be able to compile the code, you need to add the SDK to your compile classpath. You do not need to include the SDK in your APK though, because it is already on the device. This is where dependency configurations come in.

Gradle groups dependencies into configurations, which are just named sets of files. These are the standard configurations for an Android app or library:

  • compile

  • apk

  • provided

  • testCompile

  • androidTestCompile

The compile configuration is the default one and contains all dependencies required to compile the main application...