0% found this document useful (0 votes)
35 views5 pages

UNIT-4 (Folder Structure

The document provides an overview of the file structure of an Android project, detailing the purpose of various folders such as 'app/', 'manifests/', 'java/', and 'res/'. It explains the contents of each folder, including source code, resources, and configuration files, as well as the role of XML in defining UI layouts and app configurations. Additionally, it highlights the significance of Gradle scripts in managing build configurations for the application.

Uploaded by

bhavikas392
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views5 pages

UNIT-4 (Folder Structure

The document provides an overview of the file structure of an Android project, detailing the purpose of various folders such as 'app/', 'manifests/', 'java/', and 'res/'. It explains the contents of each folder, including source code, resources, and configuration files, as well as the role of XML in defining UI layouts and app configurations. Additionally, it highlights the significance of Gradle scripts in managing build configurations for the application.

Uploaded by

bhavikas392
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

UNIT-4

FileStructure / directory
folders of android
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.

MyAndroidApp/
│── app/
│ ├── manifests/
│ │ ├── AndroidManifest.xml
│ ├── java/
│ │ ├── com.example.myandroidapp/
│ │ │ ├── MainActivity.java (or .kt)
│ │ │ ├── OtherActivities.java
│ ├── res/
│ │ ├── drawable/
│ │ ├── layout/
│ │ ├── mipmap/
│ │ ├── values/
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ ├── styles.xml
│── build/
│── gradle/
│── .gradle/
│── .gitignore
│── build.gradle (Project-level)
│── settings.gradle
│── gradle.properties
│── local.properties
│── README.md
Explanation of Android Project Folders

1. app/ (Main Project Code)

This is the main module where your application's source code, UI resources, and manifest
file are stored.

2. manifests/ (AndroidManifest.xml)

 Contains AndroidManifest.xml, which defines the app's components, permissions,


and metadata.

3. java/ (Source Code Folder)

 Contains all Java/Kotlin source files.


 The main activity (MainActivity.java) is stored here.

4. res/ (Resources Folder)

This folder contains all UI resources like images, layouts, colors, styles, and strings.

a) drawable/ (Images & Graphics)

 Stores images, icons, and vector graphics.


 Example: logo.png, background.xml.

b) layout/ (XML Layout Files)

 Contains all UI layouts for activities & fragments.


 Example: activity_main.xml

c) mipmap/ (App Icons)

 Stores app launcher icons in different resolutions (mdpi, hdpi, xhdpi, xxhdpi,
xxxhdpi).

d) values/ (App Themes & Strings)

 Contains colors, styles, dimensions, and string resources.


 📌 Example (colors.xml):
 xml

 <resources>
 <color name="primaryColor">#6200EE</color>
 <color name="accentColor">#03DAC5</color>
 </resources>
 📌 Example (strings.xml):
 xml
 <resources>
 <string name="app_name">My Android App</string>
 <string name="welcome_text">Welcome to My App</string>
 </resources>
 📌 Example (styles.xml):
 xml
 <resources>
 <style name="AppTheme"
parent="Theme.MaterialComponents.DayNight.DarkActionBar">
 <item name="colorPrimary">@color/primaryColor</item>
 <item name="colorAccent">@color/accentColor</item>
 </style>
 </resources>
5.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.

Leveraging XML in Android Development


1. What is XML in Android?

XML (Extensible Markup Language) is used in Android to define UI layouts, resources,


and configurations. It provides a structured way to separate UI design from logic
(Java/Kotlin code), making the app more maintainable and scalable.

2. Key Uses of XML in Android


XML File Purpose

Layout XML (res/layout/) Defines UI components like buttons, text views, etc.

Drawable XML (res/drawable/) Defines custom shapes, gradients, and vector assets.

Values XML (res/values/) Stores colors, dimensions, strings, and themes.

Manifest XML
Configures app permissions, activities, and services.
(AndroidManifest.xml)

Navigation XML (res/navigation/) Defines screen navigation and fragments.

Animation XML (res/anim/) Defines animations like fade, slide, and rotation.

Defines options menus, context menus, and bottom


Menu XML (res/menu/)
navigation.

You might also like