Android Project Structure — In Details

Android Project Structure — In Details

#android #flutter #mobile #app

Project Structure in Android

app Folder

It describes the fundamental characteristics of the app and defines each of its components.

Manifest file

  • The manifest file plays an integral role as it provides the essential information about your app to the android system, which the system must have before it can run any of the app’s code.

Manifest file performs various tasks such as:

  • It names the Java package for the app as the package name serves as a unique identifier for the application.

  • It protects the application by declaring permission in order to access protected parts of the API and interact with other applications.

  • The manifest file declares the minimum level of the Android API and lists the libraries which are linked with the application.

  • The manifest file list the instrumentation classes. These classes provide profiling and other information as the application runs, but this information is removed as soon as the application is published. It remains only till the application is in development mode.

The Manifest includes many types of information, the main ones are:

  • Package name

  • Components of the app, such as activities, fragments, and services

  • Permissions needed from the user

Java/Kotlin Folder

  • This folder contains the .java/.kt source files for your project. By default, it includes a MainActivity.java source file.

  • Under this, you create all the activities which have .java extensions and all the code behind the application.

  • MainActivity.java is the actual file that gets converted to a Dalvik executable and runs your app.

res Directory

  • It is a directory for files that define your app’s user interface. You can add TextView, Button, etc. to build the GUI and use its various attributes like android:layout_width, android:layout_height, etc which are used to set its width and height.

  • The res directory is where you put things such as images, strings, and layouts. It’s included in every android project, and you can see it in the Android Studio res directory.

  • Inside the res directory, are subfolders for the following types of resources. You may have a subset of these directories, depending on the types of resources you are using in your app.

Different Resources Directories

Gradle Scripts
This is an auto-generated file that contains compileSdkVersion, buildToolsVersion, applicationID, minSdkVersion, targetSdkVersion, versionCode, and versionName.

Thank You!