W_0300_CodingforLife-BatteryLifeThatIs.pdfVIP

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
W_0300_CodingforLife-BatteryLifeThatIs

Coding for Life--Battery Life, That Is Jeff Sharkey May 27, 2009 Post your questions for this talk on Google Moderator: /events/io/questions Why does this matter? Phones primarily run on battery power, and each device has a battery budget When its gone, its gone Apps need to work together to be good citizens of that shared resource Current measured in mA, battery capacity in mAh HTC Dream: 1150mAh HTC Magic: 1350mAh Samsung I7500: 1500mAh Asus Eee PC: 5800mAh Where does it all go? Source: Values measured using an industrial power monitor at 5kHz sampling rate, and taking average power with lowest standard deviation. Where does it all go? How do these numbers add up in real life? Watching YouTube: 340mA = 3.4 hours Browsing 3G web: 225mA = 5 hours Typical usage: 42mA average = 32 hours EDGE completely idle: 5mA = 9.5 days Airplane mode idle: 2mA = 24 days What costs the most? Waking up in the background when the phone would otherwise be sleeping App wakes up every 10 minutes to update Takes about 8 seconds to update, 350mA Cost during a given hour: 3600 seconds * 5mA = 5mAh resting 6 times * 8 sec * 350 mA = 4.6mAh updating Just one app waking up can trigger cascade What costs the most? Bulk data transfer such as a 6MB song: EDGE (90kbps): 300mA * 9.1 min = 45 mAh 3G (300kbps): 210mA * 2.7 min = 9.5 mAh WiFi (1Mbps): 330mA * 48 sec = 4.4 mAh Moving between cells/networks Radio ramps up to associate with new cell BroadcastIntents fired across system Parsing textual data, regex without JIT How can we do better? Networking Check network connection, wait for 3G or WiFi Networking How can we do better? ConnectivityManager mConnectivity; TelephonyManager mTelephony; // Skip if no connection, or background data disabled NetworkInfo info = mConnectivity.getActiveNetworkInfo(); if (info == null || !mConnectivity.getBackgroundDataSetting()) { return false; } Check network connection, wait for 3G or WiFi Networking How can we do better? // On

文档评论(0)

l215322 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档