How to find out if the phone is in idle state?
I'm writing an app that reads out web APIs every 5 minutes.
Obviously I dont want to do this as long as the phone is in idle state.
How can I check this for my app?
We have moved to a new Sailfish OS Forum. Please start new discussions there.
I'm writing an app that reads out web APIs every 5 minutes.
Obviously I dont want to do this as long as the phone is in idle state.
How can I check this for my app?
In qt app you can check Qt.application.active flag. I catch the signal of change of this flag like this:
import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow
{
onApplicationActiveChanged: {
if (!Qt.application.active) {
// App not active, stop doing stuff
}
else {
// App is active again, keep on doing stuff
}
}
}
This thread is public, all members of Together.Jolla.Com can read this page.
Asked: 2014-08-03 13:40:43 +0200
Seen: 423 times
Last updated: Aug 04 '14
How to put my app into idle mode? [answered]
suggestion - 2g in idle for saving battery time
Icon templates availability [answered]
When will jolla be online while screen off?
JavaScript API for app development [answered]
Error message: xcb_connection_has_error() returned true
Possible to develop a Glympse client for Sailfish?
Stabilize the Sailfish Media API and Provide Harbour Support for Video Apps