Project Structure of Android in Eclipse

Before starting the android development, we have the need to know the structure of the any android project so that there is no chance to get the compile time error in the project. When we start the android development then we see the various folders or directories in the Eclipse IDE. Here first we will understand these directories or folders and below is the diagram of these directories:

  • src:
    • This folder contains all the java files of the android project such as MainActivity.java.
  • gen:
    • This folder contains all the java files that are generated by the ADT.
    • It contains the R.java file that is the back-bone of any android application because it contains all the references.
    • R.java file is generated automatically in which all project’s resource are indexed.
    • If this file is lost then our project will also destroyed.
  • assets:
    • This is the empty directory.
    • We can use this directory to store the raw data in it such as game data.
    • When the compilation process is started then all the original files are also compiled in the .apk file.
    • In the application program, we can read the raw data by using the AssetManager.
    • We can navigate the asset data by using the typical URI.
  • bin:
    • This is the folder that contains the android project build file.
    • Android project is converted into one file that is known as .apk (archived) file.
    • The apk file of our application is take place in the bin folder.
  • libs:
    • This folder contains the libraries for our project because the android project has the library dependency.
    • Any android project can have at least one library dependency file.
    • We can add more than one library into our project.
    • This library supports the jar file and this jar file can be support-v4.jar.
  • res:
    • This folder contains all the resources like images, layouts and values.
    • In android development, resources are the external files that are used by the code and it is compiled when the application builds.
    • This folder contains drawable folder that is used to keep the bitmap objects or images like jpeg, mpeg, png etc.
    • This folder contains layouts folder that is used to contain the layout files which are written in the XML.
  • AndroidMainifest.xml file:
    • This file is required for any android project or application.
    • It is placed at the root folder of the project and it describes all the global values for our package.
    • Using this file, we provide the permission to android application to use the device features such as Internet permission etc.
    • Using this file, we can change the order of the main activity means which activity launched at time of application launching.
  • Project.properties:
    • This file contains the all the information such as project target, android library reference etc.