Android Question Keep service running when device sleep

Devv

Active Member
Licensed User
Longtime User
How can i keep my service running when the phone goes to sleep ?

i tried CPU lock it is working very well, but it drains too much battery (on some devices up to 25%)
how could whatsapp , viber , ... always receive messages without using CPU lock or draining too much battery ?!!
 

walterf25

Expert
Licensed User
Longtime User
How can i keep my service running when the phone goes to sleep ?

i tried CPU lock it is working very well, but it drains too much battery (on some devices up to 25%)
how could whatsapp , viber , ... always receive messages without using CPU lock or draining too much battery ?!!
You shouldn't need to keep the cpu lock, a service should keep running until the OS needs resources and kills it.
 
Upvote 0

Devv

Active Member
Licensed User
Longtime User
You shouldn't need to keep the cpu lock, a service should keep running until the OS needs resources and kills it.

Yes but some devices don't kill the service instead the whole device go to sleep the service will be running but without any effect !
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
Yes but some devices don't kill the service instead the whole device go to sleep the service will be running but without any effect !
Really, i've never heard of that, and have never seen that issue personally, but anything is possible!
 
Upvote 0
Top