1, the Java code does not appear in Chinese, the most comments can appear in Chinese, Chinese unified written in the Strings.xml;
2, local variable name, static member variable name can contain only letters, the first letter of the word capital, the other letters are lowercase
3, the constant name can only contain letters and _, all uppercase letters, between words separated by _
4, name the ID in the layout file
Named mode: The logical name of the view abbreviation _ Module name _view
Common controls are abbreviated as follows
Layoutview:lv_
Relativeview:rv_
Textview:tv_
Imageview:iv_
imagebutton:im_
Button:btn_
Name of ID in 5,strings.xml
Naming pattern: Activity Name _ Function Module Name _ Logical name/activity name _ logical name/common_ logical name
Strings.xml, use activity name comments to separate the contents of the file
6,styles.xml: The continuous style of layout is extracted from the common style generic components, put into the styles.xml;
7, the server can be implemented, do not put on the client;
8, image as many as possible to split into reusable pictures
9, referring to third-party libraries to be cautious, avoid the application of large-capacity third-party libraries, resulting in a very large client package;
10, picture to. 9.png Processing
11, it is prudent to use static variable to realize the sharing between interfaces;
12,log (System name Module name Interface name, detailed description);
13, do not reuse the parent class's handler, corresponding to a class of handler should not let its subclasses use, otherwise it will cause message.what conflict
Using%1 $ s in 14,strings.xml to implement string wildcard
15, if more than one activity contains a common UI processing, then a commonactivity can be refined, the common part is called by it to handle, other activity just inherit it
16, the data must be validated, such as the character type to the digital type, if the conversion failure must have a default value, the service-side response data is valid judgment;
8.android Coding Specification