Within appstudio, is there a way to keep the screen from going to standby and locking while your app is running? I'm using appstudio desktop version 3.0.53 and configuring the quick capture template.
Thanks.
Hi Brian,
The Platform.stayAwake = true should set inside a signal handler, for example, in the code sample below, stayAwake is inside an onClicked signal. If you wish to keep the screen on when opening the app, you can put stayAwake inside Component.onCompleted.
Note: Best practice for using stay awake is to set this property to false before the app is minimized or closed.
import ArcGIS.AppFramework.Platform 1.0 ColumnLayout { anchors.fill: parent Button { text: "Enable Stay Awake" onClicked: { Platform.stayAwake = true; } } Button { text: "Disable Stay Awake" onClicked: { Platform.stayAwake = false; } } }
import ArcGIS.AppFramework.Platform 1.0 ColumnLayout {
anchors.fill: parent
Button {
text: "Enable Stay Awake"
onClicked: {
Platform.stayAwake = true;
}
text: "Disable Stay Awake"
Platform.stayAwake = false;
} }
This function appears to only work while using in the appstudio player. When I built an apk file and deployed the app through the playstore, the stayawake function did not work.
Thanks Tina, this is very helpful and a great new feature. I really appreciate the quick and detailed response. Thanks again.
I am now working with Appstudio 3.2. I am using the QuickCapture template as well. I placed "property bool stayAwake: true" in several places but I can't seem to get it to work. I would like the screen to stay on while the app is open or while the data capture page is open. Can you help me understand how to use this feature? I apologize if this seems like a basic question. Thanks for your time.
That would be great! Thx!
The upcoming AppStudio 3.2 release (December 2018) will roll out a new Platform plugin, which includes a stayAwake property that can prevent your device from going to sleep. Please keep an eye on the AppStudio 3.2 release blog post. I hope it helps.
Thanks,
Tina
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.