how to avoid deep sleep mode in android phone programmatically?
<p>I have develop one android application which will talk to server 24*7 over WiFi  but when phone goes to sleep mode it stops talking to server means socket is getting closed so for resolving this I added code to acquire partial wake lock in service onCreate() and release it on OnDestroy() method o service so even though phone goes to sleep mode my application can talk to the server.</p>

<p>Problem is: If you keep the device idle for longer period (more than 8 hours ), it stops communicating with the server and WiFi turned off. I heard about deep sleep mode of device, in this case it will shutdown CPU,WiFi etc.. so how to restrict it for getting CPU and Wifi turned off?</p>

<p>Please help me with some sample example.</p>

<p>Regards,
Piks</p>
