Android based project structure analysis

Source: Internet
Author: User

Creating the first Android project, using tools to develop Android projects, it is necessary to familiarize yourself with the project's directory structure and to see what is placed under each item. Expand the entire project, with its root structure (a different version of the SDK file directory structure will be somewhat different, but roughly the same) as shown in:

1. src Directory

This directory is an ordinary directory to save Java source files, which is the same as the SRC directory in the normal Java project.

2. Gen Catalog

This directory is used to store all content that is automatically generated by the ADT plug-in. The most important is the name of the R.java file, this Java file contains a lot of static classes, and corresponds to the following to describe the Res directory under the file. The R.java file is in read-only mode and cannot be changed by itself.

3. Android2.3.3

This represents the version of the SDK that the project uses, the build SDK that we selected when we created the project.

4. Assets Directory

This directory is used to hold resource files, but the resource files it holds cannot automatically generate static properties for static classes in the Gen directory's R.java file. Resource files under this directory can be accessed through the Assetmanager class.

5. Bin directory

This directory is not automatically generated until the Android project is compiled, and does not include this directory for projects that are not compiled. The compiled bytecode is stored in the directory. The process of compiling first is to compile the Android Java Virtual Machine (Dalvik) file Classes.dex, and then package the Classes.dex file as an APK package.

6. Libs directory

This directory is used to place some jar files that are needed during the development process.

7. Res directory

This directory is the same as the assets directory for resource files, but the biggest difference between it and the assets directory is that the resource file under the Res directory produces a static property named after the resource file name in the R.java file in the Gen directory.

The directory also includes a series of files directory, where drawable-hdpi, drawable-ldpi, drawable-mdpi directory for high, low, medium-resolution pictures, with the SDK 1.5 version of the project created by the only one drawable folder , the new version of the SDK will produce a number of folders to store pictures, mainly Android considering the image resources to adapt to the different screen resolution, the application will automatically select the corresponding image resources according to the resolution of the phone;

The layout directory is used to store an XML file of the interface layouts;

The menu directory is used to store the XML file for the menus resource;

Values an XML file that holds string resources, color resources, and dimension resources.

8. androidmanifest.xml file

This file is a project manifest file, which lists the features of the application and the system services you are using, and the various components we have developed (Activity, Service, ContentProvider, broadcastreceiver) are registered here as well.

9. project.properties file

The file we don't need to care about, it's used to tell the developer that the current project is using the Android API version without changes.

Android based project structure analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.