[SailfishDevel] Forcing application to stay active and prevent screensaver.

Kimmo Lindholm Kimmo.Lindholm at eke.fi
Mon Dec 23 19:02:49 UTC 2013


I noticed that when I use QtSensors (acceleration sensor) and I keep phone moving, it prevents screensaver not activating without touching the screen. If I let it stay in place, then screensaver activates.
(this is great as my app is completely controlled by "gravitation"..)

-kimmo

From: devel-bounces at lists.sailfishos.org [mailto:devel-bounces at lists.sailfishos.org] On Behalf Of Samuli Järvinen
Sent: Monday, December 23, 2013 9:00 PM
To: devel at lists.sailfishos.org
Subject: Re: [SailfishDevel] Forcing application to stay active and prevent screensaver.

Thanks,

Playing with ScreenSaver seems to work on emulator, but not on device. Also no errors on journalctl, so I guess the device handles the ScreenSaver at some level, but there is another mechanism for turning screen off.

-Samuli

On 23 Dec 2013, at 03:42, Gabriel Böhme <m.gabrielboehme at googlemail.com<mailto:m.gabrielboehme at googlemail.com>> wrote:


Hi,

the ScreenSaver function from QML SystemInformation should allow to keep the screen alive, BUT: this is not allowed for import in harbour applications at the moment. Due to the fact it's possibly not API stable. It was included in QtMobility in Qt4.x, but is now split up and got maybe some changes in Qt5. It worked in Harmattan and is also in SDK, if you don't want to release at harbour give it a try.

For charger - no idea, how to get this info at all, maybe also with SystemInformation, you could check the old Qt4 Docs.

Cheers, Gabriel.


--


Von meinem Nokia N9 gesendet




Samuli Järvinen schrieb am 23.12.13 00:33:
Hi,

I know this is something that more often than not should not happen. However I could not be more annoyed when the screen goes blank and I'm watching for example my position on screen and waiting for a gps fix. So short question. Is there a way to prevent application from going background and to prevent the screen from blanking via qml?

Another question, is it possible to detect if a charger is plugged in from QML or does it need .js or cpp code?

Thanks in advance,

-Samuli
_______________________________________________
SailfishOS.org<http://SailfishOS.org> Devel mailing list


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20131223/990613e0/attachment.html>


More information about the Devel mailing list