Basic Structure of an Android Project

4 min
Basic Structure of an Android Project

For me, basically it is always a good idea to prepare a cheat sheet with some fundamentals. A great thing is to go back sometimes to it and remind forgotten knowledge, because a master must always stay on top. So, let’s describe the following structure:

Basic Structure of an Android Project

/manifests

Every application has to include its own AndroidManifests.xml file. This file contains all necessary meta data about your application. For example, the main name or an icon. Also describes activities or other components of your application as well basic permissions and other librarier, which are required to run the application.

/java/<package>

This folder contains all files written in Java or Kotlin, which stands for source of an application including tests as well. Here we can put a code for processing specific tasks.

/res/drawable

Contains images like bitmap files (eg. png, jpeg), 9-Patch images (stretchable and repeatable images) and drawable shapes (xml).

/res/layout

Contains files that represent visual attributes and elements in the XML format of an Activity. In a nutshell, layout fies can be linked to Activities or other components of your application and are referenced by its filename. Each component or element inside the layout file is accesible (can be refferenced) by their own ID.

/res/menu

Contains XML files for manu application.

/res/mipmap

Includes app-launcher icons (displayed on the home screen) for several screen resolutions.

/res/values

Contains XML value files for specifying strings, colors, dimensions and so on and so forth. Strong classification under this directory is usefull for reusability if many components of the application need to use the same value or other value in the same ID as well (eg. translation).

Gradle Scripts (build.gradle [Module: app])

Allows us to customise parameters for build system, specific to the module app. This settings will override default build options used by the manifest files. Here we will usually add dependency libraries specific tou our application as well.

Conclusion

Basic knowledge is a good way to start learning about Android application. I hope that this cheat sheet will help you understand basic catalog structure, as well as helped me. I think I will visit this article some time to time to refresh the basics.


Post a Comment

Your email address will not be published. Required fields are marked *