1

I'm working on a application to send data to server every 20 mins. Here i found one difficulty because of android idle mode. In the time of idle mode the network access is been disabled to the apps as mentioned here. So in this time I can't able to communicate to the server. So to overcome that i found FULL_WAKE_LOCK, which will release the device from idle mode. But actually it will wake the screen whenever we try to send data. So we don't need that. So I tried with PARTIAL_WAKE_LOCK, which will wake the cpu with the screen off. But in this time the network also disabled. So i can't able to send the data.

I searched a lot. But i haven't found any good article regard that. So Anybody could you please tell me the programmatic way to get out of idle mode without waking the screen up.

Thanks.

Mahendran Sakkarai
  • 8,381
  • 6
  • 44
  • 66

1 Answers1

2

Maybe to late. https://stackoverflow.com/users/3049065/mahendran-sakkarai, I had a similar situation, but for a Tracking system. After a while all my services where in idle mode. I tried WhiteList, PartialWakeLock, not working. ActivityRecognition and the LocationServices were down for a good while.

The solution went through register a broadcastReceiver with an Intent Filter for PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED and calling if(isDeviceIdleMode()) then restart LocationUpdated. This workaround forced the device to go out of idle.

Community
  • 1
  • 1
UncleShell
  • 21
  • 5