Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>I've heard this really hurts the battery life. Is that true?</p> </blockquote> <p>Not necessarily. On most Android devices, both <code>HttpClient</code> and <code>HttpUrlConnection</code> can support <code>Keep-Alive</code>, so if your HTTP server is set up properly, and you make the requests in fairly rapid succession, I would not expect a major difference.</p> <blockquote> <p>In the individual submission, the client can get the files when he wants if he wants them.</p> </blockquote> <p>If you mean that they might be requesting them over a substantial period of time, this will not be able to leverage <code>Keep-Alive</code>. However, it may be that you will request fewer files overall and consume substantially less bandwidth. It is impossible to tell you, in the abstract, which will be better for battery consumption.</p> <blockquote> <p>Is the effect on battery life so great that it would be a valid option to overstep on bandwidth?</p> </blockquote> <p>That would depend on how much you are downloading, how frequently, etc.</p> <p>However, IMHO, you are focusing on the wrong problem.</p> <p>If you are consuming <em>so</em> much bandwidth that you are worried about battery life, your users will be attacking you with pitchforks and pickaxes for costing them so much money on their metered data plan.</p> <p>Hence, I would use <code>TrafficStats</code> and try out various scenarios to see how much bandwidth you really use, and therefore whether you need to find ways to consume less bandwidth in general (e.g., poll less frequently), so users are not bankrupted by your app. I suspect that your battery concerns will take care of themselves as a side-effect.</p> <p>However, if in your testing, you find your app showing up on the "battery blame screen" in Settings, <em>then</em> start worrying about battery consumption, whether from bandwidth or other sources (e.g., excessive use of <code>WakeLocks</code>).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload