I building a Android based SMS Server.
It shall request server (each x seconds) for new SMSes to send (in an infinite loop). The Android device will be always plugged-in via USB to the server.
The fetching of the new messages is running as a service and I need it to run 24/7. Since battery draining is not an issue here, how should I use the WakeLock?
As I read some articles about the partial lock it seems to be sufficient.
But yet I did not find any clues when should I call the wakeLock.acquire(); and wakeLock.release();
I do not suppose that it could work like that:
while(true){
wakeLock.acquire();
//Do stuff
wakeLock.release();
Thread.sleep(10000);
}
Considering the idea... Any inputs would be greatly apperciated. For example does it make sense to scheduler a daily restart of the phone so it will not get stucked? etc...