Structure of the Android Project

This section takes MyRainmaker App as an example to introduce the structure of an Android project. There are two folders in the root directory, namely app and Gradle Scripts. The app folder contains all the code and resources to develop the smartphone app, and the Gradle Scripts folder contains scripts related to Gradle compilation. The structure of this Android project is shown in Figure 10.1.

Figure 10.1. Structure of the Android project

App folder

The app folder contains three subfolders: manifests, java, and res.

  • manifests: Stores app configurations, including name, version, SDK, and permissions.

  • java: Mainly stores source code and test code.

  • res: Stores all project resources.

Gradle Scripts folder

The Gradle Scripts folder contains build.gradle (two files with the same name),,,, settings.gradle, and

  • build.gradle: Compiles the app with Gradle.

  • Configures the Gradle version.

  • Configures proguard rules to obfuscate the code.

  • Configures Gradle-related global properties.

  • settings.gradle: Configures relevant Gradle scripts.

  • Configures the path to the SDK/NDK.