[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Translation issue"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples/Code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
减少网络耗电量
您的应用向网络发出的请求是主要的耗电来源,因为需要开启高功耗的移动或 WLAN 无线装置。除了发送和接收数据包需要消耗电量之外,这些无线装置还会消耗额外电量,仅仅用来开启并保持唤醒。仅仅是每 15 秒一次的网络请求就能让移动无线装置持续保持开启,并迅速耗尽电池电量。
本节课介绍如何标记应用的源代码,根据网络请求的发起方式对其进行分类、可视化和着色。其中,每个类别都标识了您的应用中可以提高电池效率的一个方面。
-
收集网络流量数据
-
了解如何检测应用代码,并收集网络资源使用情况的相关数据。
-
分析网络流量数据
-
了解如何分析应用为响应用户操作而使用网络资源的情况,并进行优化以降低功耗。
-
优化用户发起的网络使用行为
-
了解如何优化应用为响应用户操作而使用网络资源的情况,以降低功耗。
-
优化应用发起的网络使用行为
-
了解如何优化应用对网络资源的请求,以降低功耗。
-
优化服务器发起的网络使用行为
-
了解如何优化应用对网络资源的请求,并降低功耗。
-
优化常规网络使用行为
-
了解如何优化应用对网络资源的请求,并降低功耗。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Translation issue"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples/Code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-05-29 UTC.