WifiLock keeps the device on Wifi and prevents the device policy of shutting
down wifi and switching to 3g after 15 minutes of screen off.

Holding a wifilock should normally be sufficient to complete a download
since even in the power optimized state (screen off), the device should
still wake up on packet reception and they should get handled by the device
- though the packet loss in screen off state tends to be higher and the
download will be slower.

If you want to ensure the cpu is awake the whole time, you can hold a
wakelock as well.

Thanks

On Mon, Mar 28, 2011 at 10:31 AM, Mark Carter <[email protected]>wrote:

> From what I gather, WifiLock and WakeLock work completely independently and
> if you are downloading a large file over Wifi then you will need to acquire
> both locks??
>
> Ideally, you would want something like this:
>
> 1. Acquire partial WakeLock
> 2. Preparing to download large file, check whether on Wifi or not.
> 3. If on Wifi, then acquire WifiLock. If not, then prevent device switching
> to Wifi (is this possible?)
> 4. Start download
> 5. When download has finished, release all locks.
>
> Is this correct?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to