0% found this document useful (0 votes)
43 views6 pages

Understanding Android Project Structure

The document outlines the folder structure of an Android project created in Android Studio, detailing the purpose of key folders such as Manifests, Java, res (Resources), and Gradle Scripts. It explains the contents of each folder, including the AndroidManifest.xml file, Java source files, resource files for images and layouts, and Gradle configuration files. This structure is essential for organizing app modules, source code, and resources during Android app development.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views6 pages

Understanding Android Project Structure

The document outlines the folder structure of an Android project created in Android Studio, detailing the purpose of key folders such as Manifests, Java, res (Resources), and Gradle Scripts. It explains the contents of each folder, including the AndroidManifest.xml file, Java source files, resource files for images and layouts, and Gradle configuration files. This structure is essential for organizing app modules, source code, and resources during Android app development.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Android Project folder Structure

Last Updated : 02 Jan, 2025

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

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

Manifests Folder
Manifests folder contains [Link] for crea ng our android
applica on. This file contains informa on about our applica on such as the
Android version, metadata, states package for Kotlin file, and other applica on
components. It acts as an intermediator between android OS and our
applica on.
Following is the manifests folder structure in the android applica on.

[Link]

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

<manifest xmlns:android="h p:// [Link]/apk/res/android"

package="[Link] on">

<applica on

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">
<ac vity android:name=".MainAc vity">

<intent-filter>

<ac on android:name="[Link] [Link]" />

<category android:name="[Link]" />

</intent-filter>

</ac vity>

</applica on>

</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 MainAc [Link] file will create
automa cally under the package name “[Link]firstkotlinapp”
as shown below.

MainAc [Link] and MainAc [Link]

JavaKotlin

package [Link] on;

import [Link];

import [Link] vity;


public class MainAc vity extends AppCompatAc vity {

@Override

protected void onCreate(Bundle savedInstanceState)

[Link](savedInstanceState);

setContentView([Link] vity_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
applica on.

res/drawable folder

It contains the different types of images used for the development of


the applica on. We need to add all the images in a drawable folder
for the applica on development.
res/layout folder

The layout folder contains all XML layout files which we used to define the user
interface of our applica on. It contains the ac vity_main.xml file.
<?xml version="1.0" encoding="u -8"?>

<[Link]

xmlns:android="h p:// [Link]/apk/res/android"

xmlns:app="h p:// [Link]/apk/res-auto"

xmlns:tools="h p:// [Link]/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context=".MainAc vity">

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Hello World!"

app:layout_constraintBo om_toBo omOf="parent"

app:layout_constraintLe _toLe Of="parent"

app:layout_constraintRight_toRightOf="parent"

app:layout_constraintTop_toTopOf="parent" />

</[Link]>

res/mipmap folder
This folder contains [Link] 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 defini ons. One of the most important files is the [Link] file
which contains the resources.
<resources>

<string name="app_name">NameOfTheApplica on</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 configura on that can be applied to all modules in
our applica on. In [Link] (Project) there are buildscripts and in
[Link] (Module) plugins and implementa ons are used to build
configura ons that can be applied to all our applica on modules.

You might also like