The Wayback Machine - http://web.archive.org/web/20240930161319/https://www.geeksforgeeks.org/android-project-folder-structure/
Open In App

Android Project folder Structure

Last Updated : 30 Aug, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Android Studio is the official IDE (Integrated Development Environment) developed by the JetBrains community which is freely provided by Google for android app development. After completing the setup of Android Architecture we can create an android application in the studio. We need to create a new project for each sample application and we should understand the folder structure. It looks like this:

Image

The android project contains different types of app modules, source code files, and resource files. We will explore all the folders and files in the android app.

  1. Manifests Folder
  2. Java Folder
  3. res (Resources) Folder
    • Drawable Folder
    • Layout Folder
    • Mipmap Folder
    • Values Folder
  4. Gradle Scripts

If you’re looking to deepen your knowledge of Android development and effectively utilize the project structure, consider enrolling in the Android Development with Kotlin course . This course offers comprehensive guidance on building Android applications, with a strong emphasis on Kotlin and best practices for organizing your projects.

Manifests Folder

Manifests folder contains AndroidManifest.xml for creating our android application. This file contains information about our application such as the Android version, metadata, states package for Kotlin file, and other application components. It acts as an intermediator between android OS and our application.

Following is the manifests folder structure in the android application.

Image


AndroidManifest.xml

XML
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http:// schemas.android.com/apk/res/android"
    package="com.geeksforgeeks.myapplication">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

Java folder

The Java folder contains all the java and Kotlin source code (.java) files that we create during the app development, including other Test files. If we create any new project using Kotlin, by default the class file MainActivity.kt file will create automatically under the package name “com.geeksforgeeks.myfirstkotlinapp” as shown below.

Image


MainActivity.kt and MainActivity.java

Java
package com.geeksforgeeks.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);
    }
}
Kotlin
package com.geeksforgeeks.myapplication

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

    class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)
            setContentView(R.layout.activity_main)
    }
}

Resource (res) folder

The resource folder is the most important folder because it contains all the non-code sources like images, XML layouts, and UI strings for our android application.

Image


res/drawable folder


It contains the different types of images used for the development of the application. We need to add all the images in a drawable folder for the application development.

res/layout folder


The layout folder contains all XML layout files which we used to define the user interface of our application. It contains the activity_main.xml file.

XML
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http:// schemas.android.com/apk/res/android"
    xmlns:app="http:// schemas.android.com/apk/res-auto"
    xmlns:tools="http:// schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

res/mipmap folder

This folder contains launcher.xml files to define icons that are used to show on the home screen. It contains different density types of icons depending upon the size of the device such as hdpi, mdpi, xhdpi.

res/values folder


Values folder contains a number of XML files like strings, dimensions, colors, and style definitions. One of the most important files is the strings.xml file which contains the resources.

XML
<resources>
    <string name="app_name">NameOfTheApplication</string>
    <string name="checked">Checked</string>
    <string name="unchecked">Unchecked</string>
</resources>

Gradle Scripts folder

Gradle means automated build system and it contains a number of files that are used to define a build configuration that can be applied to all modules in our application. In build.gradle (Project) there are buildscripts and in build.gradle (Module) plugins and implementations are used to build configurations that can be applied to all our application modules.

Image




Previous Article
Next Article

Similar Reads

Android Studio Project Structure VS Eclipse Project Structure
Eclipse is a standard package that is ideal for java and plug-in development, as well as introducing new plugins. Eclipse is mostly used for Java because it is basically developed in Java. One of the reasons Eclipse is well-known for its Java IDE is because of this. To personalize the environment, Eclipse includes its own workspace and a flexible p
4 min read
Fix "Error running android: Gradle project sync failed. Please fix your project and try again" in Android Studio
In this article, we will see how to fix the error: "Gradle project sync failed. Please fix your project and try again" in Android Studio". Before getting into the solution part, let's discuss Gradle. What is Gradle? Gradle is an open-source build automation tool that automates the creation of applications. The various steps involved in creating an
5 min read
Assets Folder in Android Studio
It can be noticed that unlike Eclipse ADT (App Development Tools), Android Studio doesn’t contain an Assets folder in which we usually use to keep the web files like HTML. Assets provide a way to add arbitrary files like text, XML, HTML, fonts, music, and video in the application. If one tries to add these files as "resources", Android will treat t
4 min read
How to Create Anim Folder & Animation File in Android Studio?
The animation is a method in which a collection of images is combined in a specific way and processed then they appear as moving images. Building animations make on-screen objects seem to be alive. To apply Animations to the Application sometimes we need to make an anim folder in Android Studio to store the animation file under the resource folder
2 min read
How to Add Image to Drawable Folder in Android Studio?
The resource folder is the most important folder because it contains all the non-code sources like images, XML layouts, UI strings for the android application. In Android Studio inside the res folder, one can find the drawable folder, layout folder, mipmap folder, values folder, etc. Among them, the drawable folder contains the different types of i
3 min read
How to Create New Package Inside Src Folder in Android Studio?
A package is a namespace that combines a set of relevant classes and interfaces. Conceptually one can consider packages as being similar to various folders on your computer. One might have HTML pages in one folder, images in another, and scripts or applications in yet another. Because in android, software written in the Java/Kotlin programming lang
2 min read
Resource Raw Folder in Android Studio
The raw (res/raw) folder is one of the most important folders and it plays a very important role during the development of android projects in android studio. The raw folder in Android is used to keep mp3, mp4, sfb files, etc. The raw folder is created inside the res folder: main/res/raw. So we will simply create it inside the res folder. But befor
4 min read
How to Create Menu Folder & Menu File in Android Studio?
Menus are the common user interface component in almost all the application. This interface provides a few options from which the user can select an option. There are 3 types of menu types available in Android: Options menu and app barContext menu and contextual action modePopup menuHow to define Menu in XML? In android, we can build the menu on ou
3 min read
How to Open a Specific Folder Via Intent in Android?
In this article, we are going to open a specific folder from our App. This feature is useful in many cases. Most of the time when we want to upload any file then the app simply opens the file manager. But we can implement this feature for effective use like whenever any user wants to upload any file then the user will simply choose the folder name
3 min read
How to fix Could not find folder 'tools' inside SDK in Android?
There are many IDEs available for developing android development. Many developers prefer using Eclipse as an IDE for building android applications. While using Eclipse IDE for android development many times we will get to see an error message as Could not find folder tools inside SDK folder. In this article, we will take a look at 4 different ways
3 min read
How to Access Data or Data Folder in an Android Device?
Android Operating System offers several storage methods to save your app data and images, audio files, docs, etc. App-specific storage: It only stores the data that is used by your App.Shared Storage: It stores files including images and documents.Databases: It provides a local Database for your app (for example, SQLite) In this project, we access
7 min read
Android | res/values folder
The res/values folder is used to store the values for the resources that are used in many Android projects including features of color, styles, dimensions, etc. In this article, we will learn about the res/values folder. Below explained are a few basic files, contained in the res/values folder: colors.xmldimens.xmlstrings.xmlstyles.xml1. colors.xml
3 min read
How to Clone Android Project from GitHub in Android Studio?
Android Studio provides a platform where one can build apps for Android phones, tablets, Android Wear, Android TV, and Android Auto. Android Studio is the official IDE for Android application development, based on IntelliJ IDEA. One can develop Android Applications using Kotlin or Java as the Backend Language, and it provides XML for developing Fro
3 min read
Different Ways to fix "Error running android: Gradle project sync failed" in Android Studio
Gradle is one of the most important components of Android apps. It handles all the backend tasks and manages all the external dependencies which we will be going to use in building our Android Application. Sometimes due to any issue or after formatting of your pc. Some of the Gradle files may get deleted unexpectedly. So when you will start buildin
3 min read
How to Add Resource File in Existing Android Project in Android Studio?
Android resource file is a file that stores resources needed for the UI part of an android application. Like: Layout files, drawable files, etc. In the android application, it is very often that we need another resource file for another purpose in the existing application. There are many types of resource files Layout files, Drawables, Menus are so
1 min read
Android | Android Application File Structure
It is very important to know about the basics of Android Studio's file structure. In this article, some important files/folders, and their significance is explained for the easy understanding of the Android studio work environment. In the below image, several important files are marked: All of the files marked in the above image are explained below
3 min read
How to create project in Android Studio using Kotlin
As we know Kotlin plugin is bundled with Android Studio above version 3.0, we can build android application using Kotlin language instead of Java. Below are the steps to create a new project in Kotlin programming Language. Step 1: In Welcome to Android Studio screen, select Start a new Android Studio Project. Step 2: Select Empty Activity and click
1 min read
Different Ways to Search All the Occurrences of a String in the Entire Project in Android Studio
When we are building a complex application in Android Studio, then it is always preferable to have a basic idea about the different shortcut keys which are used in Android studio to make your tasks easier. So in this article, we will take a look at some shortcut keys which we can use to find usages of any string variable in your entire Android Proj
3 min read
How to Add a Library Project to Android Studio?
Adding an external library in Android Studio is a very common thing but still, most beginners or freshers find it difficult to do. Some of you must have gone through this. Whenever you want to add some external library and you try to do that with maven(File > Project Structure > Dependencies) and try to add your dependencies there but when yo
4 min read
Different Ways to Change the Project Name in Android Studio
When you have worked a lot on an Android project and then if you need to rename the project there are lots of configuration files, .xml files, and gradle files in Android Studio that you’re afraid to break things up. Sometimes we end up creating a new Android Studio project, with the correct name and then pass the source files from the old project
2 min read
Different Ways to Add Stacktrace or debug Option when Building Android Studio Project
While developing your favorite app, you might at some point of time arrived upon this strange error, :GfGapp:processDebugResources FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugResources'. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to
2 min read
How to Add Support Library to Android Studio Project?
An android support library is part of Android SDK tools. You can use the Android Support Library for backward-compatible versions of new Android features and additional UI elements and features not included in the standard Android framework. Each package in the support library has a version number in three parts (X.Y.Z) that correspond to an Androi
3 min read
Different Ways to Set Gradle Home While Importing Existing Project in Android Studio
Gradle has its own Groovy library, thus it is not necessary to install Groovy. Gradle ignores any current Groovy installation. Gradle will utilize the first JDK it finds in your path. Alternatively, you may change the JAVA HOME environment variable to refer to the appropriate JDK's installation location. But sometimes, as software is unpredictable,
2 min read
6 Weeks of Android App Development - FREE Project Based Learning
Are you among the ones who want to learn Android App Development from the beginning? Are you someone who doesn't have any idea about Android App Development? Or you have just started your journey, but you don't know whether you are on the right path or not. So, during your initial journey, all you need is proper guidance. If you get your guide, the
15+ min read
What is Flow in Kotlin and How to use it in Android Project?
To build an app asynchronously we have to use RxJava and it is also one of the most important topics in Android Development. But now in Kotlin Jetbrains came up with Flow API. With Flow in Kotlin now we can handle a stream of data sequentially. Flow is a stream processing API in Kotlin developed by JetBrains. It’s an implementation of the Reactive
4 min read
How to Use Dagger in a Multi-Module Project in Android?
We know about the Dagger dependency injection framework and how to use it in a single module project. Dagger is basically used for reducing or completely getting rid of the unnecessary boilerplate code. We have already seen step-by-step usage of the dagger library in android, check it here. But in this article what we are going to learn is much mor
6 min read
How to Create Admin & Client App in One Project Using Android Studio?
You all must know about projects in which two applications are required one for the client and the other for the admin. Here we will see how we can implement both the applications under a single project in android studio. Let us see the step-by-step implementation of this procedure. Step by Step Implementation Step 1. Create a new project Open a ne
2 min read
How to Integrate a Flutter Module into Your Android Project?
Flutter is an open-source UI software development kit created by Google. It is used to develop cross-platform applications for Android, iOS, Linux, macOS, Windows, and the web from a single code-base. It uses Dart as the programming language. Dart is an Open-Source, client-side programming language. It is easy to learn, stable, and creates high-per
2 min read
Photo Picker in Android 13 with Example Project
In many android applications, we get to see that they are picking images from the user's device and displaying that images within the android application. For image picking, android applications use intent within the android application. In this article, we will take a look at How to implement Photo Picker in Android 13. A sample video is given bel
3 min read
Flutter - Android Studio Not Showing Project Files
There are a couple of errors that come up while making an Android app. Making the project requires less time rather than debugging the same project with errors. One such error is that when we develop a project and when we open it after a few days it does not show us the files present in the folder, assets folder, pubspec.yaml, and various other fil
3 min read