Android the next day (the composition structure of the project)

Source: Internet
Author: User

1:SRC Folder Analysis:

HelloWorld
----src (source folder)
Mainactivity: Main interface class
----Gen (automatically generated source folder)
R.java: Corresponding res folder
The following three internal classes are also included
-----drawble: Corresponding picture resources
-----Layout: Layouts
-----Strings: String Constants

/**
*mainactivity
* Application of the main interface class
* Main interface: Click the app icon to start the interface
* Inherit one of the four components activity
*/
public class Mainactivity extends Activity {

/**
* Method of rewriting
* OnCreate: Called automatically when the current class object is created (automatically called by the system)----callback method
* Callback method: Not our own call, is the system under certain conditions of automatic invocation, the basic start with On, OnXXX ()
* These methods we do not need to call, generally just go to rewrite the method
*/
@Override
protected void OnCreate (Bundle savedinstancestate) {
Call the parent class to do some default initialization work
Super.oncreate (savedinstancestate);
Set content view: Sets the content view to display for the window
Specifies the variable that the layout file corresponds to in R, and the load layout file is eventually displayed in a new window
The R class corresponds to the res file, and the class contains some static constants
Setcontentview (R.layout.activity_main);
}
}

2:bin folder

Apply the compiled file location (compile: Run Android aplication)

1). APK----contains the app's. apk files and other files-----The APK file does not contain the jar package, because the phone contains the relevant jar package

2): Classes.dex: Files generated after multiple. class files are compressed and packaged

3:libs file

Third-party jar package storage Path

4:res folder (Resource folder)

DRAWBLE--XX: Picture Folder
In order to adapt to different resolutions of the mobile phone
Layout: Layouts file for interface
Functions similar to HTML
Values: Constants Folder
String.xml: Contains a fixed string that is referenced in the layout: @String/name

Android the next day (the composition structure of the project)

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.