Android Network Optimization for Alibaba Cloud pen test questions, Alibaba android

Source: Internet
Author: User

Android Network Optimization for Alibaba Cloud pen test questions, Alibaba android

I remember this was an exam question from Alibaba School.

The answer is that my friends are working together and there are some erratic things. If you need them, you can make a reference. (For details, refer to Baidu.) You are welcome to give better suggestions!


On the client side:
1. reduce the number of network requests, merge network requests as much as possible, and query multiple scattered data in one query. perform local cache processing for network data 3. set the time-out time for data compression and transmission. For example, if you want to obtain the list data from the server, it is best to compress the server stream and receive the compressed stream. This will speed up and save traffic. 3. multi-thread processing, do not stop waiting for network operation results, put time-consuming work and computing in sub-thread 4. client request data should be as concise as possible, which data requests and data should be requested, and the data should be retrieved through paging query, timestamp, lastId, and other queries to avoid getting a lot of unnecessary data at a time. compress the data of a single request. For example, Gzip compresses http data communication. The difference value 6 can be transmitted for continuous data (such as longitude and latitude coordinate sequences. for resource files and slices, multiple versions are saved and requested. The large image is asynchronously loaded 7. the response should be timely and provide friendly prompts as much as possible, prompting the user to wait. Use ProgressBar or ProgressDialog, and do not make the user feel that the program is "stuck"
In terms of front-end:
1: Reduce http requests, adopt push mechanism 2: Combine and compress resources, CSS Sprites merge CSS Images, and Inline Images use data: URL scheme: embed an image into a page or CSS. 3: script base. 4: Use browser cache. 5: load html when loading the page for the first time, and then load js. 6: Use HTML5 and CSS3.0 to simplify the page

On the server side:
1. Do your best to design databases and reduce the number of network requests.
Business Design Optimization:
1: cloud-based configuration. (Important cloud configuration parameters) 2: componentized design, development, dynamic loading 3: Network Communication Module encapsulation, unified processing of returned data (JSON-Mode)

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.