Skip to content

Android Directory Structure

codepath-wiki-review[bot] edited this page May 29, 2026 · 13 revisions

Overview

Within an Android project structure, the most frequently edited folders are:

  • src - Java source files associated with your project. This includes the Activity "controller" files as well as your models and helpers.
  • res - Resource files associated with your project. All graphics, strings, layouts, and other resource files are stored in the resource file hierarchy under the res directory.
  • res/layout - XML layout files that describe the views and layouts for each activity and for partial views such as list items.
  • res/values - XML files which store various attribute values. These include strings.xml, dimens.xml, styles.xml, colors.xml, themes.xml, and so on.
  • res/drawable - Here we store the various density-independent graphic assets used in our application.
  • res/drawable-hdpi - Series of folders for density specific images to use for various resolutions.
  • res/mipmap - most commonly used for application icons. See this section for more details.

The most frequently edited files are:

  • res/layout/activity_foo.xml - This file describes the layout of the activity's UI. This means the placement of every view object on one app screen.
  • src/.../FooActivity.java - The Activity "controller" that constructs the activity using the view, and handles all event handling and view logic for one app screen.
  • AndroidManifest.xml - This is the Android application definition file. It contains information about the Android application such as minimum Android version, permission to access Android device capabilities such as internet access permission, ability to use phone permission, etc.

Other less edited folders include:

  • build - Build outputs produced by Gradle, including generated source files (the modern equivalent of the Eclipse-era gen directory) under build/generated/ and the final APK/AAB under build/outputs/. This folder is regenerated on every build and should be excluded from source control.
  • assets - Uncompiled source files associated with your project; Rarely used.
  • libs - Module-local libraries. Drop any private .jar/.aar files here and reference them from build.gradle with implementation(fileTree("libs")); remote dependencies are pulled from Maven repositories declared in the project-level build.gradle instead.

References

Finding these guides helpful?

We need help from the broader community to improve these guides, add new topics and keep the topics up-to-date. See our contribution guidelines here and our topic issues list for great ways to help out.

Check these same guides through our standalone viewer for a better browsing experience and an improved search. Follow us on twitter @codepath for access to more useful Android development resources.

Clone this wiki locally