Android Project Folder Structure

JetBrains community developed Android Studio, the official IDE (Integrated Development Environment) for Android app development and is freely distributed by Google.

After the complete Android Architecture setup, we can construct an Android application in the studio. For each sample application, we should establish a new project and learn the folder structure.

After setting up an Android development environment in Android Studio, we can create an example application, and our project folder structure will look like this. If you are unfamiliar with creating an application using an Android studio, please check out this Android Hello World App.

Android Project Folder Structure

The structure of the Android project on disk can differ from the above picture. Select Project from the Project selection instead of Android to see the Project's actual file structure.

Many app modules, source code files, and resource files are included in the Android project. We'll go through all of the Android app's directories and files.

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

Manifests Folder

This folder includes the AndroidManifest.xml, which we will use to create the Android application. This file holds information about our programs, such as the Android versions, metadata, the states packages for the Kotlin code, and other app components. It functions as a bridge between the Android operating system and our application.

Let's see the manifests folder structure of the Android application shown below.

Android Project Folder Structure

AndroidManifest.xml

XML code:

<? 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 holds all of the java and Kotlin source code (.java) files created during app development, as well as additional Test files. When we begin a fresh Java project, the class file MainActivity.java is automatically produced under the package name "com.example.myapplication1" as seen here.

Android Project Folder Structure

Java Code

package com.example.myapplication1; 
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 Code

package com.example.myapplication1 
 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 essential because it provides all of our android application's non-code sources like XML layouts, photos, and UI strings.

Folder of res/drawable

It consists of the various sorts of photos used in the application's development. For the application development, we should place all of the pictures in a drawable folder.

Android Project Folder Structure

Folder res/layout

The layout folder includes all of the XML layout files we utilised to define our application's user interface. It contains the file activity main.xml.

XML Code

<? 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>

Folder res/mipmap

This section includes launcher.xml files that specify the icons on the home screen. It has several icon densities based on the device size, such as hdpi, mdpi, and xhdpi.

Folder res/values

The Values folder contains various XML files such as strings, dimensions, colors, and style definitions. The strings.xml file, which includes the resources, is one of the most crucial.

XML Code

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

Gradle Scripts directory

Gradle is an automated build system that includes several files that create a build configuration. Buildscripts are used in the build.gradle (Project), and plugins and implementations are used in the build.gradle (Module) to make settings that may be used by all of our application modules.

Android Project Folder Structure

Related Topics

Android Toast

Android is one of the most successful operating systems available in today's world. It is an open-source phone platform, compatible with almost all the devices. There are numerous features and...

3 minutes read.

Top 7 Android App Development Books

Do you want to create Android apps but don't know where to start? One should first be familiar with the basics of Android before we discuss these books. With the...

5 minutes read.

Assets folder in Android

You might have noticed that unlike the Eclipse ADT (App Development Tools), the Android Studio does not have an Assets folder, which is mainly used to store the web resources...

3 minutes read.

Android Date picker example

How to pick date from the user in Android? Write an android example to pick date from the user and display it. Android provides control for the user to pick a date...

3 minutes read.

Android ScrollView

A ScrollView is a view group that is used to create vertically scrollable views in an android application. Only a single direct child can be contained by ScrollView. For placing...

5 minutes read.

Android Styles and Themes

Android styles allow you to design the appearance (for example, colors, size, and fonts) of Android UI components from XML resource files. With this method, you only need to set...

5 minutes read.

Jetpack Architecture Components in Android

A collection of software elements, libraries, tools, and instructions is called Android Jetpack. It is available to assist in creating reliable Android applications. Jetpack, which was introduced by Google in...

8 minutes read.

How to crop Image from Camera and Gallery in Android?

In this tutorial, we'll learn how to crop photos in the Android Gallery and Camera. There is no crop feature in this project, contrary to what was covered in the...

5 minutes read.

Android TextView

Widgets are user interface (UI) elements that help users to interact with Android applications. It is one of many equipments that can be used to improvise the user interface of...

4 minutes read.

Android Emulator

A tool for creating Android virtual devices (including software and virtual hardware) on your personal desktop is known as Emulator. We can use these virtual devices as the target device...

4 minutes read.

Difference between android developer and web

From a small business to a big firm, every organization in the world of technology requires a digital market presence and only mobile applications and websites/web applications provide for digital...

4 minutes read.

How to insert an email in android application in android version 8

Email Address Insertion It is used to insert email adrress from the user in the android application.The only point of difference between an EditText and an Emailtext is that EmailText consisits...

1 minute read.

Android Studio Resources

To build an outstanding Android application there are many items that you need to use. Aside from the coding of your application, you need to handle various resources such as...

5 minutes read.

How to insert the mobile number on an android application using EditText

Number Insertion in android application: Sometimes while dealing with numbers, we don't want to insert any string inside an number so, we premiliary define an EditText so we externally specify...

2 minutes read.

Creating a Calendar View App in Android

This article demonstrates how to make an Android application that uses CalendarView to display the Calendar. It also provides the option to pick the current date and view the date....

3 minutes read.

Android Broadcast Receivers

Android applications can send or receive broadcast messages from the Android operating system and other Androidapplications, like the publish-subscribe design pattern. When an event of interest happens,these broadcasts are sent. For...

4 minutes read.

How to Update Gradle in Android Studio?

The Android Gradle plugin adds a number of features that are unique to develop Android apps to the Gradle build system, which is the foundation of the Android Studio development...

2 minutes read.

Android Activity

What is an Activity? Android Activity is a screen in the user interface of an Android application. In this way, Android activity is very similar to the desktop application window. An...

4 minutes read.

Different Ways to Create aar File in Android Studio

A file called an Android archive file (*.aar) can be created using Android Studio and comprises classes and methods that use related files and classes for Android. The Android library...

4 minutes read.

Android EditText

In Android, EditText is a UI widget utilized to allow the user to input or change the text. While using the EditTextwidget in your Android application, you need to use...

4 minutes read.