Sound not play on screen lock

As i am trying to develop an app which alerts me when particlar xAccel and yAccel value reaches.Whenever the screen gots lock it will not not play sound whenever the above condition match.
Is sound is not playing due to screen lock...if yes kindly guide me.

Show your blocks.

Sorry mam

It should play (at least as long as the sound isn't streamed). But maybe you have mistakenly enabled PlayOnlyInForeground in the designer.

PlayOnlyInForeground was unchecked.
on screen change it works but when screen got lock then it will not play.

So the question is not whether the sound will be played in idle mode (because it will), but whether the .AccelerationChanged event will be fired in idle mode.

AccelerationChanged event is firing properly

Post the aia or a small test aia.

test.aia (10.9 KB)
Good Mornning Mam,
I sharing the project file.

No, not in the background (neither in idle mode nor when the screen is in the background).

So you have to use the KeepScreenOn method from @Taifun's TaifunTools extension.

See also here:

OK mam..thanks.

I am also working under battery monitoring system using taifun extension in which the app monitors the battery charging percentage in every time interval. And give alarm on reaching 100%.
On screen open it will works but it will not work if screen lock.
I cannot use keep screen on method also in this project.
Any another alternative to resolve the issue..

This sounds like a nice feature for an app... as you already found out, it unfortunately does not work... my guess is, the BatteryChanged event does not fire if the device is locked?

However probably a user does not like it very much to get a wake up call in the middle of the night because the battery reached 100%?

I could think about a feature to send a notification if a previously defined value is reached, for example 100% or any other value... if you want me to spend some time in this feature and you like to sponsor this, please contact me by email or PM for further discussion... Thank you...


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

For sake of battery life I am working for it...
Generally whenever battery got swell the shopkeeper always tell you overcharged your battery. I also faced this situation.
After wards this idea came into my brain.

Thanks for your interest..