Keeping mobile app awake / prevent screenlock

Get help using Construct 2

Post » Sun Nov 08, 2015 6:55 pm

@AndreasR - I put the Acquire action on the very first layout, triggered on Start of Layout event (in a sub-event checking for if it's on an Android or iOS mobile platform. I set my phone's screen timeout to 30 seconds, and even with the Acquire action in place, the phone still times out and goes to sleep.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 775
Reputation: 14,824

Post » Sun Nov 08, 2015 6:58 pm

Rhindon wrote:@AndreasR - I put the Acquire action on the very first layout, triggered on Start of Layout event (in a sub-event checking for if it's on an Android or iOS mobile platform. I set my phone's screen timeout to 30 seconds, and even with the Acquire action in place, the phone still times out and goes to sleep.


I have the same problem on Android (Cordova -> Intel XDK -> Crosswalk). I haven't tested on iOS yet.
B
32
S
7
G
4
Posts: 398
Reputation: 4,591

Post » Sun Nov 08, 2015 7:25 pm

https://www.dropbox.com/s/5qb2yhy8tefbz ... .capx?dl=0
There are only two event sheets in the program. No matter which "On Start of Layout" I utilize, it doesn't work.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 775
Reputation: 14,824

Post » Mon Nov 09, 2015 2:21 pm

You need to add the plugin to your Intel XDK Project

Code: Select all
Repo URL: https://github.com/cranberrygame/cordova-plugin-powermanagement


I updated the docs for that: https://shatter-box.com/knowledgebase/p ... anagement/

Then it should work.

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

Post » Tue Nov 10, 2015 12:25 am

@AndreasR - I did that, and then I get this error:
Image
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 775
Reputation: 14,824

Post » Tue Nov 10, 2015 1:07 am

Okay, scratch that last comment - I got it added just fine without an error.
New problem... With the plugin now referenced through the link you provided, I pushed the project to the Testing Server in the Intel XDK Test tab. I then loaded the project via the Intel XDK mobile app and the same problem continues... The phone still goes into screenlock/sleep mode.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 775
Reputation: 14,824

Post » Tue Nov 10, 2015 7:03 pm

Rhindon wrote:Okay, scratch that last comment - I got it added just fine without an error.
New problem... With the plugin now referenced through the link you provided, I pushed the project to the Testing Server in the Intel XDK Test tab. I then loaded the project via the Intel XDK mobile app and the same problem continues... The phone still goes into screenlock/sleep mode.

As I'm aware, the Test tab (testing server) in Intel XDK doesn't support 3rd party plugins, you have to build the app and then test .apk file.
B
32
S
7
G
4
Posts: 398
Reputation: 4,591

Post » Wed Nov 11, 2015 12:43 am

@grigrizljac - Ya know, I had a FEELING that was the deal!!! LOL
Thank you for the confirmation.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 775
Reputation: 14,824

Post » Wed Nov 11, 2015 2:16 am

@AndreasR, I tried downloading the package but the ZIP file won't decompress on my PC, is that expected?

Link: https://shatter-box.com/downloads/cranb ... n-package/
B
72
S
14
G
1
Posts: 151
Reputation: 4,999

Post » Wed Nov 11, 2015 8:30 pm

I have added the plugin to Intel XDK, but the screen still turns off ... (Android)
B
32
S
7
G
4
Posts: 398
Reputation: 4,591

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: marcinkowski, Shenkai the ssj and 22 guests