Rabbit--android charge

Source: Internet
Author: User

speech at the 09 Google IO Conference Jeffrey Sharkey (Coding for Life-battery life, which is)
Discusses this problem, pointing out that the power consumption of Android applications is mainly in the following three areas:

The transmission of large amounts of data.


Keep switching between the networks .
Parse a large amount of text data.
And put forward the related optimization suggestions:
In a program that requires network connectivity, first check that the network connection is normal, and if you do not have a network connection, you do not need to perform the appropriate program.
Using highly efficient data formats and parsing methods, JSON and PROTOBUF are recommended.
When downloading large amounts of data, try to download it using the Gzip method.
Other: Recycle Java objects, especially large Java pairs, using the Reset method, not too high on the positioning requirements, try not to use GPS positioning,
may use WiFi and mobile network cell location, try not to use floating point arithmetic, get screen size and other information can use caching technology, do not need to make multiple requests;
Use Alarmmanager to periodically start a service instead of a timed task that uses sleep mode.
As an app developer, few people will notice the app's power loss, but the user is very sensitive to battery power, and the app will optimize its power consumption to add a lot to its app.
If a good responsible developer, you should limit the impact of the app on the power, when there is no network connection, disable background service updates,
Reduce the frequency of updates when the battery is low and make sure your app has minimal impact on the battery.
Maximize app refresh rate when battery is charged or power is saturated



The more times the CPU wakes up, the greater the power consumption. Many applications now register alarm services in order to maintain heartbeat, pull data, and actively push
Causes the Android system to wake up frequently.
That's why Lei June says that when Android phones are installed with TOP100 applications, the standby time can be significantly shortened.

Rabbit--android charge

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.