Android traffic control-list page

Source: Internet
Author: User

1. The simplest mode:
Design:

1. Pass the page number value to the server so that the server can return the corresponding page number data.
2. Data Cache: only the first page of data is cached.
Benefits:

1. Easy to implement and brainless
Disadvantages:

1. A waste of traffic, if the user has been waiting for someone to send messages. Then the user will be refreshed. At this time, we reload the first page. This design is definitely not suitable. It loads a lot of useless data.
Use Cases: complete the project as soon as possible. This mode can be used when Demo is provided to the customer.
2. the most boring design:
Design:

1. Refresh: Send the id or generation time of the last data record to the server. Then let the server return the data to us.
2. load the next page: Pass the last piece of data on the User display page to the server, and then let the server send us the id and indication value (which can be time) of the data contained in the corresponding list, we compare the processed data with the local data, and send the list of missing or marked IDs to the server. Then, the server sends the data of the requested IDs to us.
3. Data Cache: cache all data as much as possible
Benefits:

1. Save traffic, whether it is when the user is refreshing or viewing the data on the next page that has already been viewed. You can return the correct data to the user.
Disadvantages:

1. Redundancy Design. You only need to look at this logic, and the amount of code will certainly be large.
2. Increase the server pressure. When the intermediate server is determined based on user information, it will certainly increase the server pressure. Yes, too. If the number of users is not large. We can consider it.
3. A waste of mobile phone storage space. In the middle, we will certainly cache user data. This cache may be valid or invalid. Depends on the situation.
Applicable scenarios: when the number of people is small and data is frequently viewed. It can effectively save traffic.
3. Discount design:
Design:

1. Refresh: Send the id or generation time of the last data record to the server. Then let the server return the data to us.
2. When loading the next page, we will pass the corresponding page number to the server to request the corresponding data.
3. Only the first page of data is cached.
Benefits:

1. Simple implementation
2. Do not waste too much traffic, and optimize the data for the first page of data (this assumption is more concerned with the latest data. Like SNS. Yesterday, you saw a message from your friend. Are you interested in reading it again ?)
3. directly request data when loading the previous page. There are not many redundant caches to save resources on the mobile client.
Disadvantages:

1. If the user often goes through the previous data, it may be a waste of traffic.
Applicable scenarios: SNS are social networking. Generally, the first data review does not show the second data review.

 

Even an excellent design industry cannot cope with all the situations. Different countermeasures can be formulated based on different situations to produce excellent software.

More related articles http://c.jinhusns.com

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.