Quick Start to android Learning 1-Analysis of android project files

Source: Internet
Author: User

After several days of attacks, android should be an entry point. Now let's review it and give it to those who need to learn android.
I used to learn C ++ embedded systems and write programs under wince. I have never done anything about java. I spent half a day browsing the java syntax and watched a video about environment setup, project establishment, and activity introduction in "Lao Luo android development video tutorial. Then I started to look at the sample project.

First, understand the android project file

When you get a strange project, first analyze its directory and study what the research is and what it is. Here, we will analyze the files under android. First, we can see the figure. The red box is the focus and will be used more in the future.

(1) src folder--source code

The src directory contains the Java source file. Several Java packages can be created in this file, and the processing logic of the application can be created in the package. The Activity of the application is stored in this directory, click Create a project to open it.

 

(2) gen directory---automatically Generated (Generated) files

The Java package under the gen directory contains the "R. java" file, which is automatically generated by Eclipse. Developers do not need to modify or maintain the content. This file is very useful !! It is closely linked to another folder, and operations on resources under res will lead to R. java file re-compilation, R. the constant classes defined in java also indirectly help the Activity to apply and manage resources. The advantage of the android design is that complex resources are managed through specialized classes, convenient and secure.

 

(3) assets-engineering asset management Node

Mainly manages the asset material files introduced by the android Project

(4) res-Project Resource Management Node

Mainly manages the introduced resource material, which includes three subnodes

A. The drawable subnode is used to manage the image resources, images, and icon that can be drawn;

B. layout subnodes are used for layout management, that is, the display of interface controls. There are five layout methods for them;

C. values subnodes are used to manage constant values, similar to common sense statements in C;

(5) androidManifest. xml---important files

It contains the project information and components. It is an important document! You can obtain the package name, android version, component, and SDK version of the project. The application node indicates the current application. The application contains a unique Activity component. The Activity uses the specified action (main) and category (LAUNCHER) of the intent object (intent) to start. This section also describes the activity name and activity attribute used in the project, for example, horizontal screen: android: screenOrientation = "landscape". The screen is displayed in portrait mode by default.

(6) default. properties-Project property file Node

This file is automatically generated by the android tool and mainly records the version information of the target android platform.

Summary: Just a few days ago, from the perspective of my design project, we have used many SRC Source program directories, drawable files, layout files, androidmanifest files, and values files, other files are basically unchanged. In subsequent articles, we will introduce the properties of source files, layout files, and androidmanifest files.

 

Related Article

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.