Android Studio Directory Structure
app/
This is your main module directory, typically named app. It contains all the source code and resources
for your application.
app/src/: Contains your actual source code and resources.
Files/subfolders:
▪ main/ (production code)
Subdirectory Purpose
i. java/ or kotlin/ Contains Java/Kotlin source files
ii. res/ Resource files like layouts, strings, drawables
Folder Purpose
i. layout/ XML files for activities/fragments
ii. drawable/ Images, vector files, shapes
iii. values/ XMLs for strings, colors, dimensions
iv. mipmap/ Launcher icons for various densities
v. raw/ Arbitrary raw files (e.g., audio, videos)
iii. AndroidManifest.xml - Declares components and permissions
app/build.gradle (Module-level): Defines build settings specific to this module (dependencies, plugins,
etc.)
build/ - Generated at compile time. Stores compiled code, intermediates, etc. Do not edit anything
here manually. It’s automatically managed.
gradle/ - Contains the Gradle wrapper files:
File/Folder Purpose
i. gradle-wrapper.properties Sets the Gradle version for your build
ii. gradlew, gradlew.bat Shell scripts to invoke Gradle
.idea/ - Stores IntelliJ/Android Studio project metadata (e.g., code styles, run configs).
build.gradle (Project-level) - Configures build for all modules (repositories, plugins)
settings.gradle - Declares all included modules (e.g., :app, :library)
local.properties - Stores local SDK paths
gradle.properties - Defines build settings (like JVM args, project-wide configs)
Kotlin
Kotlin is a modern, expressive programming language developed by JetBrains, designed to be fully
interoperable with Java.
It’s the preferred language for Android development, officially supported by Google since 2017.
When to Use What?
• Use Kotlin if you want modern features, cleaner syntax, and you're working on Android or
cross-platform apps.
• Use Java if you're maintaining legacy systems, working in enterprise environments, or need
maximum compatibility.
What Gradle Does
Gradle automates tasks like:
• Compiling code
• Packaging APKs or JARs
• Running tests
• Managing dependencies
• Deploying builds
AndroidManifest.xml
The AndroidManifest.xml file is the blueprint of your Android app. It tells the Android system
everything it needs to know to run your app properly. Here's what it does and what it typically
contains:
What It Does
• Declares your app’s package name, version, and SDK requirements.
• Lists all components: activities, services, broadcast receivers, and content providers.
• Specifies permissions your app needs (like internet access or camera).
• Defines intent filters to handle specific actions (e.g., launching from a URL).
• Sets themes, icons, and hardware requirements.
Build
In Android Studio, “build” refers to the process of compiling your app’s source code, resources, and
assets into an installable package—usually an APK or AAB (Android App Bundle). It’s powered by
Gradle, the build system that automates everything from dependency resolution to code shrinking.
What Happens During a Build?
1. Source Compilation: Kotlin/Java files are compiled into .class files.
2. Resource Merging: Layouts, drawables, and strings are merged and processed.
3. DEX Conversion: Compiled code is converted into .dex (Dalvik Executable) format.
4. Packaging: Everything is bundled into an APK or AAB.
5. Signing: The app is digitally signed (debug or release key).
6. Optimization: Tools like ProGuard or R8 shrink and obfuscate code (for release builds).