- Gradle is the official build system for Android development
- Contains Gradle caches
- You'll hardly interact with this, unless you have a weird bug and need to clear the cache.
- One way to delete this cache is to delete this folder. It is auto-generated.
- .gitignore'd
- Contains IDE specific configurations
- Code Styles
- Run Configurations
- etc.
- .gitignore'd
- Contains info used for running Gradle
- gradle-wrapper.jar: Script that invokes a declared version of Gradle, downloading if necessary.
- gradle-wrapper.properties: Contains info about what version of Gradle to use.
- Good place to put global gradle scripts (declaring dependencies, common build configs, etc.)
- Project wide gradle settings. These get overridden by the IDE.
- These files are used to invoke Gradle on the command line.
- Use gradlew on Unix systems, gradlew.bat on Windows.
- CI systems tend to use this to execute builds.
- For example:
./gradlew testDebug
- List all modules to be compiled here.
- An Android app is composed of 1 or more modules.
- A single
app
module is created by default. - Modules are logically related groups of code that have the ability to compile in parallel.
- Larger apps will want to structure their app using a multi-module architecture to improve build times.
- Module specific info such as dependencies or language info.
- Will hardly interact with this file.
- .gitignore'd
- File used to store Android SDK & NDK location
- .gitignore'd
- Top level build.gradle
- Contains top level build configurations, settings that apply to all modules
- Gradle plugins
- Repositories to fetch dependencies from
- Contains build configurations and dependency info per module.
- Where all major components of your app are declared to the Android system
- Permissions
- Activities (including launcher Activities)
- Services
- BroadcastReceiver
- NOT Fragments
- Non-code resources for your app. Includes layouts, icons, UI strings etc.
- Most icons you see in an app will be drawables.
- Can take many forms
- png/mipmaps
- Image files. Usually a density bucket (mdpi, xhdpi) is required, but not always.
- Vector Drawables
- Series of drawing commands, scales to any screen size
- Android Asset Studio provides a bunch
- Supported natively on API 21+, use support drawables otherwise.
- AS can convert SVG into vector drawables
- Resource qualifiers are used to tell the system when/how the resource should be used
- API
- -v24, -v21
- Screen
- -xhdpi, -mdpi
- Screen size
- -sw800
- Screen ratio
- long: Long screens, such as WQVGA, WVGA, FWVGA
- notlong: Not long screens, such as QVGA, HVGA, and VGA
- Language
- -en, -es
- Store color constants for your app here
- Store UI related strings here
- This file tends to get very long. It can be broken down into _strings.xml
- App wide themes/styles
- Can also declare styles to be used
- This is where all the layouts for your app live.
- Use different layouts depending on your need.
- Most common will be ConstraintLayout, LinearLayout, FrameLayout
- This is where the code lives.
- Main production code goes here.
- This is where all unit tests should live.
- These tests are run on the JVM, so shouldn't have any Android dependencies.
- Most tests should be unit tests.
- Tend to run very fast.
- This is where instrumentation tests live.
- These tests are run on a physical device and tend to be slower.