Android Introductory Learning Summary

Source: Internet
Author: User

1, Manifest.xml is the program runtime read files, is the core configuration file, also read activity from it

2, the main code files stored in the Mainactivity.java, the inside fixed will have OnCreate function will be setcontentview specified content r.layout.activity_main;

3, Activity_main.xml is a layout file, storage layout, such as placed buttons, text boxes and so on;

4, R.java management of a lot of resources, such as layout, string, image, Mp3 and so on;

5. To add a call function to a button: Double-click the button to navigate to the presence of the button activity_ Main.xml the location in the layout file, add the OnClick event function name to it, and then add the onclick function to the Mainactivity class in the Mainactivity.java file, with the Activity_ The function names configured in main are consistent;

6. A reference to a string type value (or other type), such as the name of the button, can be added in the Strings.xml of the Values folder under the Res folder, and then through R.string. Added resource Name

7, the internationalization of resources: the 6th is the default reference file, if it is in different languages reference different string values, you can build the corresponding language folder in the Res folder, such as the Chinese Values folder name: VALUES-ZH-RCN; Create a new or copy string.xml file inside the file, configure the resource with the same name in the original String.xml, when the running Environment system language is configured in Chinese, the name corresponding value of String.xml under the Values-zh-rcn folder is automatically called;

Android Introductory Learning Summary

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.