Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Did u consider using <a href="http://developer.android.com/reference/android/app/Service.html" rel="nofollow noreferrer"><strong>service</strong></a>? </p> <blockquote> <p><a href="http://developer.android.com/reference/android/app/Service.html#WhatIsAService" rel="nofollow noreferrer">Service</a> is providing a facility for the application to tell the system about something it wants to be doing in the background (even when the user is not directly interacting with the application). By starting it, system will schedule work for the service, to be run until the service or someone else explicitly stop it.</p> </blockquote> <p>I guess that can help.. Cheers</p> <p><strong>EDIT:</strong> Oki, u didn't mention services before.. I am still not sure if u have two problems (draining battery AND not receiving data) or just one where u r receiving data with drain..?</p> <p>Considering draining battery u could experiment with different flags of <a href="http://developer.android.com/reference/android/os/PowerManager.html" rel="nofollow noreferrer"><strong>WAKE_LOCK</strong></a>.</p> <p>Important thing I noticed is that you didn't <strong>release</strong> lock with <code>mPartialWakeLock.release()</code> as adviced on linked <a href="http://developer.android.com/reference/android/os/PowerManager.html" rel="nofollow noreferrer">WAKE_LOCK</a> page:</p> <blockquote> <p>Device battery life will be significantly affected by the use of this API. Do not acquire WakeLocks unless you really need them, use the minimum levels possible, and be sure to release it as soon as you can.</p> </blockquote> <p>Additionally, according to some other <a href="https://stackoverflow.com/questions/9871860/partial-wake-lock-power-drain-in-android-phones">posts</a>, battery drain speed depends on work and effectiveness of things u r doing in the service, so this is where we are not able to help without seeing more of the code.. :S</p> <p>Btw.. IMHO if u just wait for incoming call and u keep WAKE_LOCK all the time, that might be a reason of high drain of battery.. Think what u need what for and try to minimize use of resources if u don't need them..Consider WIFI_LOCK for example, and release WAKE_LOCK as soon as possible..</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