Keeping mobile app awake / prevent screenlock

Get help using Construct 2

Post » Wed Oct 28, 2015 6:45 am

I have a countdown timer app that requires the phone to stay awake during the entire sequence.
I have the Browser object added, but I don't see any conditions/actions that will keep the phone active. Nor do I see any other object that would do the trick.

Thank you for your help!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 777
Reputation: 14,826

Post » Wed Oct 28, 2015 7:20 pm

*bump from 2nd page*
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 777
Reputation: 14,826

Post » Wed Oct 28, 2015 7:30 pm

Looks like you already found the only plugin supporting that..
Not sure if it's still available and if and how good it works, but I guess you'll have to wait for an answer in the plugin thread, for I also can't find it in the link provided in the opening post..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Oct 29, 2015 1:21 am

Thank you, @LittleStain. Yeah, nothing I have found has been helpful at all. Always leads to a dead-end.

@Ashley, do you have any sure-fire suggestions?
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 777
Reputation: 14,826

Post » Thu Oct 29, 2015 12:09 pm

Is this in the browser or via Cordova or another platform?

I think for Cordova there was a third party plugin that could do it. Browsers might keep the screen on if you enter fullscreen mode, but it might not, it's something web pages could easily abuse to waste device's battery.
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,694

Post » Thu Oct 29, 2015 1:46 pm

Rhindon wrote:Thank you, @LittleStain. Yeah, nothing I have found has been helpful at all. Always leads to a dead-end.

@Ashley, do you have any sure-fire suggestions?


You can download the plugins here: https://shatter-box.com/downloads/cranb ... n-package/
Use the "Phonegap Powermanagement" plugin.

Install it, insert it in your project and add "On start of layout - Acquire"
Docs: https://shatter-box.com/knowledgebase/p ... anagement/

Note that cranberrygame (the plugin author) now only makes paid updates / support. The plugins in those package are the latest free available versions, so there might be newer (premium) versions. You can get the permium plugins here: https://plus.google.com/communities/117 ... 5005605917
But the Power Management plugin works fine ;)
Image Image iTunes: Match3 | Google Play: Match3
B
98
S
33
G
30
Posts: 1,117
Reputation: 27,791

Post » Thu Oct 29, 2015 8:54 pm

@Ashley - It's through Cordova. I'm using Intel XDK. I must admit that Cordova, Intel, Crosswalk...I know they're all related somehow, but I haven't fully grasped what's-what, so that's all I can say for sure. I'm exporting through Cordova and using Intel XDK to prepare the project for mobile.

@AndreasR - Thank you. I was looking at some of cranberrygame's stuff in other threads but couldn't find a viable option through that. I'll check out your links...
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 777
Reputation: 14,826

Post » Thu Oct 29, 2015 11:53 pm

I got the Power_Management plugin...plugged in.
But I do not understand the purpose of the Acquire or the Release actions.
And none of the resources or links I have clarify this.
Could you explain those to me, please?
@cranberrygame, perhaps you could clarify, please?
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 777
Reputation: 14,826

Post » Fri Oct 30, 2015 5:18 am

Hi,

This is how it works.

Acquire: Starts keeping the screen awake.
Release: Stops keeping the screen awake.

So trigger acquire on the start of the first layout. The screen will stay awake till you release it with "Release".

Regards
Andy
Image Image iTunes: Match3 | Google Play: Match3
B
98
S
33
G
30
Posts: 1,117
Reputation: 27,791

Post » Fri Oct 30, 2015 8:41 pm

@AndreasR - Thanks. I believe I already applied that but maybe I missed something. I'll double-check my work...
Thank you for the details!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 777
Reputation: 14,826

Next

Return to How do I....?

Who is online

Users browsing this forum: darkrealos, DharmaOne and 15 guests