Android Project Structure

Every Android Project has a specific directory structure. The Android build tools do a few extra things to prepare the actual application that will run on the device or emulator.

Basic Structure

When you create a new Android project ( via Command Line android create project), you gets the following in the project's root directory:
  • AndroidManifest.xml: An XML file that describes the application being built and what components (activities, services, etc) are being supported by the application.
  •  customizable properties for the build system. You can edit this file to override default build settings used by Ant.
  • assets/: Directory holds other static files that you want packaged with application for deployment on tho the device.
  • bin/: The directory that holds the application once it is compiled.
  • build.xml: Used as part of the Apache Ant based command line build process.
  • gen/: Directory in which Android's build tools place source code that they generate.
  • jni/:  Contains native code sources developed using the Android NDK.
  • libs/: Directory holds any third-party JARs your application requires.
  • progurd.cfg: Used for integration with ProGuard to obfuscate your Android Code.
  • res/: Directory holds resources ( icon, GUI layout etc).
  • src/: Directory holds the Source Code.

Details of bin/ directory
  • bin/classes/: Holds the compiled Java Classes
  • bin/classes.dex: Holds the executable created from those compiled Java Classes.
  • bin/yourapp.ap_: Holds your application resources, packaged as a ZIP file.
  • bin/yourapp-*.apk: The actual Android Application (where * varies).

 Details of res/ directory
  • res/drawable/: For images 
  • res/layout/: For XML-based UI layout specifications
  • res/menu/: For XML-based menu specifications
  • res/raw/: For general purpose files 
  • res/values/: For strings, dimensions, etc
  • res/xml/: For other general purpose XML files

No comments:

Post a Comment