Stop phonelock....?

Get help using Construct 2

Post » Thu Jun 28, 2012 2:39 am

I have made an app which plays audio (ambient sound). I need to prevent the phone from locking so that the app stays open and screen on, (the screen is part of the ambience)

is it possible?

thanks all :)
B
4
Posts: 6
Reputation: 462

Post » Thu Jun 28, 2012 3:13 am

I don't know if your are targeting Iphone but seems this behaviour must be specified by users/players in general "settings" and not by C2 dev ! ... so if a user want his phone to be locked after 3 minutes in all apps when doing nothing you must not prevent him to do so ! ;-p

Of course some apps use direct access to mobile feature to do the job ...
for example using this kind of code :

[[UIApplication sharedApplication] setIdleTimerDisabled:YES];

naelian2012-06-28 03:31:23
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Post » Thu Jun 28, 2012 3:25 am

[QUOTE=naelian] I don't know if your are targeting Iphone but seems this behaviour must be specified by users/players in general "settings" and not by C2 dev ! ... so if a user want his phone to be locked after 3 minutes in all apps when doing nothing you can't prevent him to do so ! ;-p[/QUOTE]

I'm talking about a droid but for iPhone that is not true, if you was to watch a movie on it or live tv with tvcatchup, it wouldn't lock regardless of settings, in my app, I have a few different frames that play along with audio, your not meant to touch just watch and listen, but the phone eventually locks :(. Really need a way to stop this or my app is kinda pointless.
B
4
Posts: 6
Reputation: 462

Post » Thu Jun 28, 2012 3:34 am

Sorry you post too fast, i'm well known here to edit my post three times min before giving all details ;-p

So using "only" C2 i think is not actually possible to do so ... but if you are exporting your project toward another product giving access to some native mobile feature like "phonegap" i think it could be possible.naelian2012-06-28 03:40:01
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Post » Thu Jun 28, 2012 10:18 am

I don't think this is currently possible, but Mozilla are working on standardising features to lock the screen to always on, so hopefully support will come in the near future.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Thu Jun 11, 2015 10:32 pm

Any updates on this? I'm also working on an app that needs the device always awake.
B
5
S
1
Posts: 42
Reputation: 471

Post » Wed Oct 28, 2015 6:42 am

I second that - I have a countdown timer app that needs the phone to remain awake during that time frame. Any new info would be greatly appreciated.
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Wed Oct 28, 2015 11:23 am

I'm also looking for something to prevent the screen lock.
“The best time to plant a tree is 20 years ago. The second best time is now.”
B
29
S
7
G
4
Posts: 364
Reputation: 4,444


Return to How do I....?

Who is online

Users browsing this forum: theosciandra and 26 guests