The PubNubs Android SDK background process has been optimized through many iterations. Our tests show almost no difference in battery discharge between partial blocking of tracking, doing nothing, and the PWL + PubNub socket.
Even measuring the most energy-intensive use case, which is a 4G connection, weve compared for 4 hours on a Nexus 4, the difference between standby lock and PWL + PubNub is 4% of the difference in battery for 4 hours, while the device receives a 1k message every 5 minutes. In Wi-Fi, the difference is much smaller.
While GCM has many minutes of socket timeouts ( per thread ,) PubNub is always reliable. However, you can configure PubNub to disable PWL for applications where real-time is not always required, but reliable. In our opinion, this customization makes PubNub the most convenient option for developers for energy-efficient socket communications .
If you still see a noticeable battery drain, refer to support@pubnub.com with a copy of the appropriate code so that we can help debug and report best practices.
Hooray!
source share