The Android build system is organized around a specific directory tree structure for your Android project, much like any other Java project. The specifics, though, are fairly unique to Android and what it all does to prepare the actual application that will run on the device or emulator. In this post, we’ll see a quick overview of the project structure of an android application.

When you create a new Android project (e.g., via, you get five key items in the project’s root directory:

  • AndroidManifest.xml, which is an XML file describing the application being built and what components – activities, services, etc. – are being supplied by that application
  • build.xml, which is an Ant script for compiling the application and installing it on the device
  • bin/, which holds the application once it is compiled
  • src/, which holds the Java source code for the application
  • res/, which holds “resources”, such as icons, GUI layouts, and the like, that get packaged with the compiled Java in the application
  • assets/, which hold other static files you wish packaged with the application for deployment onto the device

You will find that your project’s src/ tree already has the namespace directory tree in place, plus an Activity subclass representing your main activity (e.g., src/com/mypackage/android/ You are welcome to modify this file and add others to the src/ tree as needed to implement your application.

When first time you compile the project (e.g., via ant), out in the “main” activity’s namespace directory, the Android build chain will create This contains a number of constants tied to the various resources you placed out in the res/ directory tree. You should not modify yourself, letting the Android tools handle it for you. You will see throughout many of the samples where we reference things in (e.g., referring to a layout’s identifier via R.layout.main).

You will also find that your project has a res/ directory tree. This holds “resources” – static files that are packaged along with your application, either in their original form or, occasionally, in a preprocessed form. Some of the subdirectories you will find or create under res/ include:

  • res/drawable/ for images (PNG, JPEG, etc.)
  • res/layout/ for XML-based UI layout specifications
  • res/raw/ for general-purpose files (e.g,. a CSV file of account information)
  • res/values/ for strings, dimensions, and the like
  • res/xml/ for other general-purpose XML files you wish to ship

When you compile your project (via ant or the IDE), the results go into the bin/ directory under your project root. Specifically:

  • bin/classes/ holds the compiled Java classes
  • bin/classes.dex holds the executable created from those compiled Java classes
  • bin/yourapp.apk is the actual Android application (where yourapp is the name of your application)

The .apk file is a ZIP archive containing the .dex file, the compiled edition of your resources (resources.arsc), any un-compiled resources (such as what you put in res/raw/) and the AndroidManifest.xml file.



Tagged with: Android

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Related News Feeds

Set your Twitter account name in your settings to use the TwitterBar Section.