CPU Sleep mode and Services

Azhar

Active Member
Licensed User
Longtime User
Hello All,

Just a general question about background services:

If you want to run services in the background (or foreground if Android keeps destroying them) whether as a single service with a timer to test for event times or as a series of startServiceAt functions, do you always have to set the device as phoneWakeState with partialLock?

It seems my Motorola Defy with ICS keeps sleeping (deep sleep) and misses all it's scheduled services unless I have used the phone in the past 20 minutes or so.

Is this a device specific problem or inherent in the OS?

Will running a service with partialLock on continuously have a significant impact on power consumption?

Any comments are greatly appreciated.

Azhar
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The last parameter of StartServiceAt determines whether the service will start even if the device is sleeping. It is however possible that manufacturers ignore this flag when the device is in "deep" sleep.

Will running a service with partialLock on continuously have a significant impact on power consumption?
Yes. And it can also be ignored eventually by the device.
 
Upvote 0

jjllllp

New Member
Licensed User
Longtime User
Then it is a great problem for me.

Well, How can I generate an alarm?

then , the only way is to use notification, it is this true?
 
Upvote 0
Top