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.