I am making an administrative app for my work, but the problem is that i need to keep the device awake 24/7 so a service can send small UDP packets to my server.
My Alcatel One Touch with android 4.2.2 falls asleep no matter what.
I added a wake lock to my activity and it worked, but after 8 hours or so it seems to freeze the activity and the phone falls asleep.
I moved the wake lock to the service but nothing happens, Wakelock detector detects no wake lock.
I tried using startwakefulservice but the same happens, no wakelock is detected and it falls asleep.
It always falls asleep 20-30 minutes after.
I tried using third party programs, but none of them worked.
What could be the cause?
I rooted my phone, is there any way to change the settings so that the CPU never falls asleep? Anything i could change at all? Can the activity destroying policy be changed?
I tried the third party programs a Motorola XT914 with android 4.1.2 and it does detect it, so i guess its the phone...
The phone will always be plugged and no one will use it, so everything that gets the job done is valid.
A full wake lock seems to work perfectly, but i need the screen to become locked if it cannot turned off...