Anonymous App project summary and anonymous App Project Summary
1. At the beginning of the project, we need to prepare the entire architecture, which classes are needed, and which packages can be placed below them: there is an Aty package, a net package, and a bean package, A util package, a db package, and an adapter package are created first, and then gradually improved.
2. When determining whether an Edittext is null, use the TextUtils. isEmpty (xxx) method instead of xxx = ""
3. Benefits defined as final static: it can be called without being instantiated, and it can reduce writing errors if it is called in multiple places.
4. Familiar with SharedPreference usage.
Save: first obtain an Editor object, call the putXXX (xxx) method, and finally remember commit ()
Get: Get the getSharedPreferences method, and then d calls the getString (xxx) method based on the key to get it.
5. When you jump to another Activity, remember to finish it if you don't need it.
6. String... kvs: There are several non-quantitative parameters, which are useful.
7. An interface can be used as a data type. A variable can be defined as an interface type. However, if an interface cannot be instantiated, a new interface cannot be used, if new is required, only one new class can implement this interface. Then you can call the methods in the class.
8. Before the Activity ends, make sure to drop the dialog first to dismiss ().
9. Remember to optimize the getView method when creating the adapter. There are fixed optimization methods.
10. When defining a ListView component in xml, you need to set the id for her. In this case, set android: id = "@ android: id/list" instead of android: id = "@ + id/list", error in the second case
11. Let an Activity inherit from ListActivity, instantiate an adapter, and then call setListAdapter (adapter ).
12. You can define the data types that are not common.
13. enumeration types are actually used
14. I am more familiar with AsyncTask for asynchronous tasks, GET requests and POST requests, and understand the differences between the two.
Get is to get data from the server, post is to transmit data, get is to add the parameter data queue to the submitted url, you can see, the post operation transmits the Action attribute to the corresponding url, which is invisible to the user.
The size of data transmitted by get is small and cannot exceed 2 kb. post is generally considered unrestricted, but theoretically, the maximum size of IIS4 is 80 KB, and that of IIS5 is kb.
Get is very low in security, and post is relatively high, but the execution efficiency is relatively high in get.
Suggestion:
The get method is more secure than the Post method. If it contains confidential information, we recommend that you use the Post data submission method;
We recommend that you use the Get method when querying data. We recommend that you use the Post method when adding, modifying, or deleting data;
15. Configure the strings used in strings to facilitate modification and implement multiple languages.
16. encapsulate frequently used network connections as a tool class, which can save a lot of work.