The Modules
The “Modules” category lists all of the modules in your project and allows you to configure them. In many projects, there will simply be an app
module and nothing else. In the book’s sample projects, there are more modules than normal:
The gray undersquiggle underneath the module names means that there is a suggestion for changes to the module’s configuration. We will explore those suggestions more later in the chapter.
Module Properties
There are three tabs in the “Modules” category. The first one is “Properties”, which allows you configure items from the selected module’s build.gradle
file, such as:
- The
compileSdkVersion
- The version of the
dx
compiler,aapt
packager, and related tools that you use (buildToolsVersion
, typically left unspecified) - What version of Java to support, in terms of how that Java gets compiled (the
sourceCompatibility
andtargetCompatibility
values in thecompileOptions
closure)
Default Config
The “Default Config” tab lets you configure a variety of items that appear in the defaultConfig
closure of the selected module’s build.gradle
file:
Many of these are beyond the scope of this book. Some of the ones that we have covered are:
- The
applicationId
- The
versionCode
andversionName
- The
minSdkVersion
andtargetSdkVersion
Signing Configs
In the chapter on signing your app, we saw how to use Android Studio to sign your APK. There is another option: configuring Gradle to sign your APK. This is mostly used in cases where the APK will be generated and signed automatically, such as via a build server.
The “Signing Configs” tab contains a form for you to teach Gradle how to sign your APK:
The details of how this works, and the resulting Gradle constructs, can be found in the Android SDK documentation.
Prev Table of Contents Next
This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.