Paramclasses Academy - Blog

Tutorials Details

←
Post 9 of 40
→

What is Android Project Structure Explained: Manifest, Java, Resources and Gradle ?

What is Android Project Structure Explained: Manifest, Java, Resources and Gradle ?

November 2, 2026

Introduction

When you create a new Android project in Android Studio, the IDE automatically generates several folders and files.

Beginners often find it confusing because they do not know where Java code, XML layouts, images, app settings, and build configurations are stored.

Understanding the Android project structure is important because it helps you organize your code, manage application resources, fix errors, and build Android applications efficiently.

In this tutorial, you will learn about the main folders and files in an Android project, including:

  • AndroidManifest.xml

  • Java source files

  • Resource folders

  • Gradle build files

  • Assets folder

  • Build output folders

Let's understand each part step by step.

1. What Is Android Project Structure?

Android project structure refers to the organization of folders and files inside an Android Studio project.

Each folder has a specific responsibility.

For example:

  • Java files contain application logic.

  • XML files define layouts and other resources.

  • AndroidManifest.xml contains important application information.

  • Gradle files manage dependencies and the build process.

A well-organized project makes application development easier and helps developers find files quickly.

2. Understanding the Android Project View

When you open an Android project in Android Studio, you can see the project files in the left-side Project panel.

Android Studio provides different ways to view project files, including:

Android View: Displays files in a simplified, Android-focused structure.

Project View: Displays the actual directory and file structure on your computer.

For beginners, Android View is often easier because it groups related files together.

To change the view:

  1. Open Android Studio.

  2. Locate the Project panel on the left.

  3. Click the view dropdown.

  4. Select Android or Project.

Remember that Android View is a simplified representation. The actual directory structure can look different in Project View.

3. Main Folders and Files in an Android Project

A typical Android application module contains a structure similar to this:

MyApplication/
│
├── app/
│   ├── build.gradle.kts
│   │
│   └── src/
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   │
│       │   ├── java/
│       │   │   └── com/example/myapplication/
│       │   │       └── MainActivity.java
│       │   │
│       │   ├── res/
│       │   │   ├── drawable/
│       │   │   ├── layout/
│       │   │   ├── mipmap/
│       │   │   ├── values/
│       │   │   └── xml/
│       │   │
│       │   └── assets/
│       │
│       └── test/
│
├── gradle/
│
├── build.gradle.kts
├── settings.gradle.kts
├── gradle.properties
└── gradlew

This is an illustrative structure. Exact folders and files may differ depending on the Android Studio version, project template, programming language, and Gradle configuration.

Now let's understand the important parts.

4. What Is the AndroidManifest.xml File?

The AndroidManifest.xml file is one of the most important files in an Android application.

It provides essential information about the application to the Android operating system.

It can declare:

  • Application components

  • Application permissions

  • App-related metadata

  • Application settings

  • Supported features

The file is usually located at:

app/src/main/AndroidManifest.xml

Example of AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <application
        android:allowBackup="true"
        android:label="My Application"
        android:supportsRtl="true"
        android:theme="@style/Theme.MyApplication">

        <activity
            android:name=".MainActivity"
            android:exported="true">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>

    </application>

</manifest>

Explanation

1. manifest

The root element of the manifest file.

2. application

Contains application-level settings and component declarations.

3. android

Defines the application name displayed by the system.

4. activity

Declares an Activity used by the application.

5. android

Specifies whether components can be launched by other applications or external components, subject to Android's component access rules.

6. intent-filter

Defines the types of intents a component can respond to.

7. MAIN and LAUNCHER

These identify the Activity that appears as the application's launcher entry point.

How to Add Internet Permission

If your application needs internet access, declare the following permission outside the application element:

<uses-permission android:name="android.permission.INTERNET" />

For example:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:label="My Application">

    </application>

</manifest>

Internet permission is a normal permission and does not require a runtime permission request.

5. What Is the Java Folder?

The Java folder contains the Java source code of your Android application.

This is where developers write application logic, create classes, define methods, and handle user interactions.

Common Java files include:

  • MainActivity.java

  • LoginActivity.java

  • DatabaseHelper.java

  • Student.java

  • ApiManager.java

Typical location:

app/src/main/java/com/example/myapplication/

Example: MainActivity.java

package com.example.myapplication;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);
    }
}

Explanation

1. package

Defines the package to which the Java class belongs.

2. import

Allows the class to use other available classes.

3. MainActivity

Defines the Activity class.

4. extends AppCompatActivity

Uses inheritance to obtain Activity functionality from AppCompatActivity.

5. onCreate()

A lifecycle callback called when the Activity is created.

6. setContentView()

Sets the Activity's user interface layout.

Java source files are responsible for application behavior, while XML layout files are commonly used to define the screen structure.

6. What Is the res Folder?

The res folder stores application resources that are separate from Java source code.

It is usually located at:

app/src/main/res/

It can contain layouts, images, icons, colors, strings, styles, and other resources.

Let's understand its important subfolders.

A. drawable Folder

The drawable folder stores drawable resources such as:

  • Background shapes

  • XML drawable files

  • Vector drawable icons

  • Image resources

Example location:

res/drawable/

Example drawable XML:

button_background.xml

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <solid android:color="#2196F3" />

    <corners android:radius="12dp" />

</shape>

This creates a blue background with rounded corners.

You can apply it to a Button or another suitable View.

B. layout Folder

The layout folder contains XML files that define application screens and user interface components.

Example:

res/layout/activity_main.xml

Example: activity_main.xml

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="20dp">

    <TextView
        android:id="@+id/textView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Welcome to Android"
        android:textSize="22sp" />

    <Button
        android:id="@+id/btnClick"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Click Me" />

</LinearLayout>

This layout creates a screen containing a TextView and a Button.

C. mipmap Folder

The mipmap folder is commonly used for application launcher icons.

Example:

res/mipmap/

It can contain launcher icons for different screen densities.

Android Studio may generate multiple mipmap folders for different density configurations.

D. values Folder

The values folder stores XML resources such as:

  • strings.xml

  • colors.xml

  • themes.xml

  • dimens.xml

These files help keep reusable values separate from layouts and Java code.

Example: strings.xml

<resources>

    <string name="app_name">My Application</string>
    <string name="welcome_message">Welcome to Android</string>

</resources>

You can use these values inside XML:

android:text="@string/welcome_message"

You can also access them from Java:

String message = getString(R.string.welcome_message);

E. xml Folder

The xml folder stores additional XML configuration resources.

Depending on the application, it may contain:

  • Backup rules

  • Data extraction rules

  • File provider paths

  • Other XML configurations

For example, a FileProvider configuration may be stored in this folder.

7. What Is the assets Folder?

The assets folder stores files that the application needs to access in their original file form.

Unlike standard Android resources, assets are accessed using AssetManager.

It can contain:

  • JSON files

  • HTML files

  • Fonts

  • Text files

  • Other application data

Typical location:

app/src/main/assets/

Example: Reading a Text File From Assets

First, create a file named:

message.txt

Place it inside the assets folder.

Now read it using Java:

try {

    InputStream inputStream = getAssets().open("message.txt");

    BufferedReader reader = new BufferedReader(
        new InputStreamReader(inputStream)
    );

    String message = reader.readLine();

    reader.close();

    System.out.println(message);

} catch (IOException e) {

    e.printStackTrace();
}

You will need the following imports:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

Explanation:

  • getAssets() accesses the application's assets.

  • open() opens the requested file.

  • BufferedReader reads the file content.

  • readLine() reads one line of text.

  • close() releases the file resources.

Use assets when you need to access files directly rather than reference them through the Android resource system.

8. What Is Gradle in Android Studio?

Gradle is a build automation system used by Android Studio to build Android applications.

It helps manage:

  • Project configuration

  • External libraries

  • Dependencies

  • Build variants

  • Compilation

  • APK and Android App Bundle generation

Gradle uses build scripts to understand how your application should be built.

Modern Android projects commonly use Kotlin DSL files ending in .gradle.kts. Older projects may use Groovy files ending in .gradle.

A. app/build.gradle.kts

This file contains configuration for the app module.

Example:

plugins {
    alias(libs.plugins.android.application)
}

android {

    namespace = "com.example.myapplication"

    compileSdk = 35

    defaultConfig {

        applicationId = "com.example.myapplication"

        minSdk = 23

        targetSdk = 35

        versionCode = 1

        versionName = "1.0"
    }
}

dependencies {

    implementation("androidx.appcompat:appcompat:1.7.0")
}

This is an illustrative configuration. SDK versions and dependency versions should match the requirements of your project.

Important Gradle Settings

1. namespace

Defines the namespace used for generated application code, including the R class.

2. compileSdk

Specifies the Android SDK version used to compile the application.

3. applicationId

Defines the unique application identifier used for installing and publishing the app.

4. minSdk

Defines the minimum Android API level supported by the application.

5. targetSdk

Specifies the Android API level the application is designed and tested against.

6. versionCode

An integer used to identify the application version for updates.

7. versionName

A human-readable version string displayed to users or tools.

8. dependencies

Lists external libraries and modules required by the application.

B. Project-Level build.gradle.kts

The project-level build file contains configuration shared across modules, such as plugin declarations.

Example:

plugins {

    alias(libs.plugins.android.application) apply false

}

The exact configuration depends on how the project is created.

C. settings.gradle.kts

This file defines the project name and which modules are included in the project.

Example:

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)

    repositories {
        google()
        mavenCentral()
    }
}

rootProject.name = "MyApplication"

include(":app")

Here, include(":app") tells Gradle that the project contains an app module named app.

9. What Is the Gradle Folder?

The Gradle folder contains files used by the Gradle Wrapper.

The wrapper helps developers run the project using the Gradle version configured for that project.

Important files include:

  • gradle-wrapper.properties

  • gradle-wrapper.jar

The wrapper configuration specifies the Gradle distribution used by the project.

This helps maintain consistent build environments across different computers.

10. What Is the Build Folder?

The build folder contains generated files produced during the build process.

It may include:

  • Compiled classes

  • Intermediate build files

  • Generated source files

  • APK files

  • Other build outputs

Example location:

app/build/

Important: Build files are generated automatically. You generally should not manually edit files inside the build folder.

Gradle can regenerate these files during future builds.

11. What Is the Difference Between Java, res, Manifest, and Gradle?

These parts have different responsibilities:

Java Folder

Contains application logic, classes, methods, and event handling.

res Folder

Contains layouts, images, icons, strings, colors, and other application resources.

AndroidManifest.xml

Declares application components, permissions, and essential application information.

Gradle Files

Manage project configuration, dependencies, SDK settings, and the build process.

Understanding these responsibilities makes it easier to locate files and manage an Android project.

12. How to Find Important Files in Android Studio

Follow these steps:

  1. Open your Android Studio project.

  2. Open the Project panel on the left.

  3. Select Android View.

  4. Expand the app section.

  5. Open manifests to find AndroidManifest.xml.

  6. Open java to find Java source files.

  7. Open res to find layouts and other resources.

  8. Locate Gradle Scripts to access Gradle configuration files.

You can also switch to Project View to see the actual folders on your computer.

13. Common Mistakes Beginners Should Avoid

1. Editing the Wrong Gradle File

Remember that the project-level and app-level Gradle files have different responsibilities.

2. Placing XML Layouts in the Wrong Folder

Standard Android layout XML files should be placed inside res/layout/.

3. Confusing assets and drawable

Use drawable resources for Android drawable assets. Use the assets folder when you need direct file access.

4. Forgetting to Declare Permissions

If an application needs a permission such as Internet access, check that the required permission is declared in the manifest.

5. Changing applicationId Without Understanding Its Impact

The applicationId identifies your application for installation and publishing. Changing it can affect app identity and updates.

6. Editing Generated Build Files

Avoid manually modifying generated files inside the build folder.

14. Practice Tasks

Complete these tasks in Android Studio:

  1. Create a new Empty Views Activity project.

  2. Open AndroidManifest.xml and identify the application and Activity declarations.

  3. Open MainActivity.java and identify the onCreate() method.

  4. Open activity_main.xml and add a TextView.

  5. Create a new string resource inside strings.xml.

  6. Create a drawable XML file with a rounded background.

  7. Open app/build.gradle.kts and identify minSdk and targetSdk.

  8. Find the applicationId in the app-level Gradle file.

  9. Create an assets folder and add a text file.

  10. Read the text file using AssetManager.

These tasks will help you understand the actual Android Studio project structure through practice.

15. Conclusion

Understanding Android project structure is an important step in Android application development.

Every major folder and file has a specific responsibility. Java files handle application logic, resource folders store UI and other resources, AndroidManifest.xml declares essential application information, and Gradle manages the build process.

Once you understand this structure, working with Android Studio becomes much easier.

Practice locating and modifying these files in your own Android project before moving to the next tutorial.

16. Frequently Asked Questions (FAQs)

Q1. What is Android project structure?

Android project structure is the organization of folders and files used to develop and build an Android application.

Q2. What is the use of AndroidManifest.xml?

It declares application components, permissions, metadata, and other essential application information.

Q3. Where is MainActivity.java located?

It is commonly located inside the app module's src/main/java/ directory, within the application's package.

Q4. What is the use of the res folder?

The res folder stores application resources such as layouts, images, icons, strings, colors, and themes.

Q5. What is Gradle in Android Studio?

Gradle is a build automation system that manages dependencies, project configuration, and the application build process.

Q6. What is the difference between assets and drawable?

Drawable resources are managed through Android's resource system. Assets are accessed directly using AssetManager.

Q7. What is the use of the build folder?

The build folder contains generated files and outputs created during the build process.

Q8. What is the difference between applicationId and namespace?

applicationId identifies the application for installation and publishing, while namespace determines the namespace for generated code such as the R class.

17. SEO Details

SEO Title: Android Project Structure Explained: Manifest, Java, Resources and Gradle

Meta Description: Learn Android Studio project structure, including AndroidManifest.xml, Java files, resource folders, assets, Gradle, and important configuration files.

Focus Keyword: Android Project Structure

Related Keywords:

  • Android Studio project structure

  • AndroidManifest.xml explained

  • Android res folder

  • Android Java folder

  • Gradle in Android Studio

  • Android assets folder

  • Android app development

  • Android Studio tutorial for beginners

Suggested URL Slug: android-project-structure-manifest-java-resources-gradle

←
Post 9 of 40
→