Android Development Practice (ii) A brief analysis of Android program structure

Source: Internet
Author: User

Don't talk nonsense, just talk about the file structure of important Android Programs

src catalog includes Project " Span lang= "ZH-CN" style= "FONT-SIZE:9PT; Line-height:22pt "> All the source files. When the project is created, it will contain two files r.java and < activity >

<activity>.java always named according to your activity: equivalent to the background, handling all business logic and references to controls

R.java is a by Android Plugin files that are automatically generated and added to your application. This file contains pointers to the drawable,layout and values directories (or other items in the directory). You should not have to modify this file directly.   

Gen: Compiler for our auto-generated R.java The file is stored here. L

Assets Catalogue used to place the "raw material" file. In this directory, you can include audio files prepared for streaming media and animations. L

b IN&NBSP: Dalvik environment. &NBSP;

a pk  file ANDROID&NBSP; JAVA&NBSP; virtual machine DALVIK&NBSP; Install and run the file, in fact this APK&NBSP; files will be generated by the compiled intermediate result and the original file. APK&NBSP; The nature of the file is a ZIP&NBSP; package. &NBSP;

file it is for java  "," "" ". virtual machine Span lang= "en-US" style= "" >DALVIK&NBSP; bytecode files run. &NBSP;&NBSP;L&NBSP;

R es: Project, res directory contains 3 subdirectory :d rawable, layout,  and  values &NBSP; &NBSP;DRAWABLE&NBSP; and values directories are placed throughout the program global string.

\res\main.xml: foreground control layout file for layout and declaration of various controls on the page

If you refer to the Res directory, its contents are included in the R.java file, in src directory, this R.java The file is automatically generated, so do not attempt to manually modify the contents of the content, because its content will be regenerated at the next compile time.   

A NDROIDMAINFEST.XML&NBSP: is a place to specify global settings jsp in Project web.xml file. andoridmanfiest.xml &NBSP;&NBSP;

When you write code in general, \res\main.xml The various controls are declared and arranged in the Activity class in the R.java class to refer to the control and the corresponding business logic processing, it is important to note that when you create a class, and then immediately go to andoridmanfiest.xml registration, or the following error, often frighten a sweat, do not know where the wrong.

<activity android:name= "Com.example.fifthtest.Method" > </activity>


Android Development Practice (ii) A brief analysis of Android program 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.