I am learning about mobile web apps, and they look interesting. Among other things, I am wondering whether there is a significant difference in battery consumption between the native apps and web apps? (Phonegap, intel xdk, etc)?
1 Answers
There can be a significant difference due to use of transceivers (i.e. the receiver and transmitter on your phone/tablet). On any mobile device, whether notebook, tablet or phone, the processor and peripherals drop into power conserving sleep states. Processor sleep states are called C-states. Peripheral sleep states are called D-states. Thus the greater battery life when your phone is idle. The longer the period of idle, whether processor or peripheral, the better the battery life.
What does this mean for web apps versus native apps? Native apps will use more of the processor but less of expensive peripherals (read that as transceiver include GPS). Both the processor and transceiver are power hogs. So here's the bottom line:
- If your web app does a lot of cloud access, it's going to pull down the battery. This is why using the GPS to give you turn by turn instructions kills your battery life (and makes your phone a little heater).
- If your native app never goes to sleep or gets any rest (e.g. it does polling instead of using interrupts, or if the interrupt period is too small), you'll pull down your battery.
So the ideal app balances native and web computation to
- minimize processor usage (more specifically, maximizes periods where the processor is idle)
- minimize peripheral usage (read that as minimize the number of web accesses)
As you can see, these goals are a little contradictory. From a designer perspective, you want to move as much computation onto the cloud while keeping data as local as possible.

- 1,463
- 1
- 9
- 11
-
Hi Taylor, I appreciate this is an old topic but I'd like to ask for a bit more info. I have a Javascript / Canvas based arcade game that uses a lot of gfx & audio. It also plays a constant soundtrack courtesy of the webAudio API. I've bundled it up using Phonegap and am currently testing it using Apple's Testflight on iPhone6. There are no external calls and no GPS usage. It's self contained in that sense. But it does perform a huge amount of functions on each game loop. I'm using wkWebView. The battery is drained a fair bit after just a couple of minutes! Any thoughts why this might be? – MarkW Apr 18 '17 at 09:32
-
After the two "Minimize" bullet list items, there is another approach and that is: bursting requests. For instance, once the app sends a request, the radio signal goes to high power, and stays there for a while. so if you send many other requests in a few seconds, you won't keep the radio in high-power mode for long. But if your app sends, say, 1 request per minute, it will never let the GSM circuitry to enter low-power state. see [here](https://developer.android.com/topic/performance/power/network/analyze-data.html) – Alireza Jun 23 '17 at 11:56