Analsying Android Studio Project Structure

·

0 min read

Screenshot (92).pngan image of Android studio Project structure

A project in Android Studio contains everything that defines your workspace for an app, from source code and assets, to test code and build configurations.The Project tool window has several views, including the Android view, the Project view, and the packages view. Each view shows the same stuff, but each view organizes this stuff a bit differently. Android and Project are the most useful views, though the Android view may hide certain folders from you. By default, Android Studio will set the view to Android. The Project tool window provides a simple tree interface with files and nested folders that you can toggle.

Screenshot (94).png an image of Project View

.idea This is thefiles where the project specific metadata is stored .

app This is the actual project folder where the application code resides. The application folder has following sub directories:

libs : This is a folder, which can hold the libraries or .jar files

src : The src folder can have both application code and android unit test script. You will find two folders named "androidTest" and "main" correspond to src folder. The main folder contains two subfolders java and res. The java folder contains all the java codes and res contains drawables, layouts etc.

gradle This is where the gradle build systems jar wrapper is found. This jar is how Android Studio communicates with gradle installed in your computer.

External Libraries This is not actually a folder but a place where Referenced Libraries and information on targeted platform SDK are shown. By default, Android Studio displays your project files in the Android view, usually the last option down. This view does not reflect the actual file hierarchy on disk, but is organized by modules and file types to simplify navigation between key source files of your project, hiding certain files or directories that are not commonly used. Some of the structural changes compared to the structure on disk include the following: The android project contains different type of app modules, source code files and resource files. We will explore all the folders and files in android app.

Screenshot (96).png Android View structure

  1. manifests- Contains AndroidManifest.xml, this file contains information about our application such as android version, metadata, states package for Kotlin file and other application components. It acts as an intermediator between android OS and our application.You can check here for more information

  2. Java- Contains the Java (.java) and kotlin (.kt) source code files, separated by package names, including JUnit and Android test code . If we create any new project using Kotlin, by default the class file MainActivity.kt file will create automatically under the package name "com.tinuade.droidcamp".**

  3. res- you can't use Uppercase letters to name your files. It containts XML layouts, UI strings, and bitmap images, divided into corresponding sub-directories. For more information about all possible resource types, see here

  4. Gradle Scripts folder -Gradle means automated build system and it contains number of files which are used to define a build configuration which can be apply 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.

Thanks for reading,I hope you enjoyed it.