Power-saving principle in wireless APP development, and power-saving principle in app development

Source: Internet
Author: User

Power-saving principle in wireless APP development, and power-saving principle in app development

The basic principles are as follows:


1. load data or initialize the module only when necessary. (It is directly related to the experience optimization brought about by pre-loading. You need to balance it yourself)

2. Determine the network status before network requests to avoid frequent retries and so on.

3. All sensor event monitoring must be enabled and canceled in a timely manner, such as accelerometer, gyroscope, and GPS.

4. Do not abuse the service on android, but the app is secretly consuming power when it is not operated.

5. Try not to register a global listener in manifest ).

6. If you have a heartbeat or polling mechanism, you must carefully consider your strategy. On android, do not use your own timer, but the Alarm Manger of the system. The timer MUST be closed in time.

7. Prevent System sleep and frequent wakeup. Do not do this.



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.