Anonymous App project summary and anonymous App Project Summary

Source: Internet
Author: User

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.

Related Article

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.