Anonymous app Project Small summary

Source: Internet
Author: User

1, in the beginning of the project to do a good job of preparing the entire architecture, what classes are required, which packages are generally available under the following: There is a aty package, a net package, a bean package, a util package, a DB package, a adapter package, and then the need to create first, And then gradually to improve.


2, judge whether a edittext is empty when should use Textutils.isempty (XXX) method instead of xxx== ""


3. The benefit of defining final static: it can be invoked without being instantiated, and there is a little bit less writing error if multiple places are called


4, further familiar with the use of sharedpreference.
Save: First get an Editor object, call Putxxx (XXX) method, and finally remember commit ()
Fetch: Get Getsharedpreferences method, then D call GetString (XXX) method according to Key to get


5, jump to another activity when you do not need to remember to finish off


6, String ... KVS: No quantitative parameters, can be a number of, this is very useful


7, the interface can be used as a data type, you can define a variable as the interface type, but not to instantiate the interface assignment can not go to the new interface, if you want to new can only be a new implementation of the interface class. Then you can call the methods inside the class


8, before the activity end must be dialog first to dismiss () off


9, when creating adapter, remember to optimize the GetView method, there is a fixed optimization method


10, in the XML definition of a ListView component, to set her ID, this should be set android:id= "@android: Id/list" instead of android:id= "@+id/list", the second situation will be wrong


11, let an activity inherit from Listactivity, instantiate a adapter and then call Setlistadapter (adapter) can


12, when you need to use the type of data is not common in those kinds of time can be defined by themselves


13, the actual use of the enumeration type


14, the asynchronous task operation Asynctask More familiar with, also mastered the GET request mode and the POST request way, understand the difference.
Get is the data from the server, post is the transfer of data, get is to add the parameter data queue to the URL of the submission, the user can see, and post is to transfer the Action property to the corresponding URL, the user can not see.
Get transmits a small amount of data, cannot be greater than 2kb,post is generally considered unrestricted but theoretically, the maximum amount in IIS4 is 100KB in 80KB,IIS5.
Get security is very low, post is relatively high, but execution efficiency is get higher
Suggestions:
The security of Get mode is less than post, and it is recommended to submit the data by post if it contains confidential information.
In the data query, it is recommended to use Get method, and in the data to add, modify or delete, the proposed post method;


15, the use of the strings are configured to strings inside, easy to modify, and easier to implement multiple languages


16, the commonly used network connection package called a tool class, can save a lot of work.

Anonymous app Project Small 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.