Lesson two-Android project directory structure

Source: Internet
Author: User

This lesson introduces the directory structure of Android projects through the Android HelloWorld project.

After the project is created, the directory structure of the project on the left shows:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4B/C2/wKioL1QyDOPhiPuGAAGffrzaB60368.jpg "title=" 1.png " alt= "Wkiol1qydophipugaagffrzab60368.jpg"/>

HelloWorld project structure mainly includes the following

    • src folder

    • Gen Folder

    • Android 4.4.2 Folder

    • 1.4, assets

    • 1.5. Res folder

    • 1.6, Androidmanifest.xml

    • 1.7, Project.Properties


The following sections describe the above levels of directory structure.

--src folder

As the name implies (SRC, source code) The folder is put into the source code of the project.

You know: We created a simple HelloWorld project, and the system generated an activity file for us. Activity is a Java class file, responsible for controlling the display of a user interface, the original Java class file is stored here, as follows:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4B/C0/wKiom1QyDcGA6xxdAABrPWl5r_0340.jpg "title=" 2.png " alt= "Wkiom1qydcga6xxdaabrpwl5r_0340.jpg"/>


--gen folder

There is a R.java file under the folder, R.java is automatically generated when the project is built, this file system automatically generated and maintained, only to see never change. It is quite the same as the administrator of our system resource repository, which records changes in the warehouse files. Any resource files that we add and delete in the warehouse are automatically recorded in the R file.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4B/C2/wKioL1QyEDHSN_KuAACi3d4Fz0E612.jpg "title=" 3.png " alt= "Wkiol1qyedhsn_kuaaci3d4fz0e612.jpg"/>

--android 4.4.2 Folder

The folder contains the Android.jar file, a Java archive that contains all of the Android SDK libraries (such as views, Controls) and APIs required to build the application. Bind your application to the Android SDK and Android Emulator via Android.jar, which allows you to use all of your Android libraries and packages and enable your application to debug in the right environment.

--assets

Contains the application system needs to use such as MP3, video class files, but also a warehouse, but this warehouse is not managed by R File Manager, when used we have to find ourselves.

--res folder

The resource directory, which is equivalent to the application's resource file warehouse, is where the resource files needed to run the application are placed, and the management of R files is accepted. It contains the resource files in your project and will be compiled into the application. When you add a resource to this directory, it is automatically recorded by R.java. Sub-folders under this folder are equivalent to the warehouse shelves, all items are stored in categories, convenient R file (warehouse manager) to manage.

All sub-folder naming has special meaning, not to be arbitrarily named, see the Android website

Http://developer.android.com/guide/topics/resources/available-resources.html

Remember: All files must be named in English lowercase, and do not appear in uppercase English.

--androidmanifest.xml file

The total configuration file for the project, documenting the various components used in the application. This file lists the features that the application provides, in which you can specify the services that the application uses (such as telephone service, Internet service, SMS service, GPS service, and so on). In addition, when you add a new activity, you need to configure it in this file, only after the configuration, you can call this activity. Androidmanifest.xml will contain the following settings: Application permissions, activities, intent filters, and so on.

As far as Androidmanifest.xml is now, the articles later in this series will be described in detail separately.

--Project.Properties file


This article is from "Feather android" blog, please make sure to keep this source http://caifly.blog.51cto.com/3433287/1560793

Lesson two-Android project directory structure

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.