system.setIdleTimer( ) support

Joshua,

Is it possible to support this api by CoronaCards in the future? My game mechanics rely on accelerometer and it’s not necessary to tap any buttons. So in a case when a player won’t shoot for a while, right now the phone locks. I’d need to disable the IdleTimer to avoid it.

Would you prefer that we fix the 60 FPS text rendering issue first?

I’m thinking that’s a higher priority.  I’ve already started digging into the text issue today.

With our new Native/Lua bridge, you can disable the idle timer yourself in C#.  You can control this via Microsoft’s PhoneApplicationService class…

  http://msdn.microsoft.com/en-US/library/windows/apps/microsoft.phone.shell.phoneapplicationservice(v=vs.105).aspx

Just get a hold of an instance of this class via its static “Current” property and then set its “ApplicationIdleDetectionMode” property to disabled.  At least that’s how it works according to what I’ve read.  I’ll look into doing this later too, but I want to make sure that I resolve outstanding issues that you can’t solve/work-around on your end first.

“ApplicationIdleDetectionMode cannot be enabled after it has been disabled.”
Does it mean that for WP8 apps you can’t change this property back and forth like on iOS/Anroid?

Regarding the custom fonts lag - I’ve already changed all my multiline text to bitmap fonts to work around the bug, but I understand it’s more urgent to fix the existing feature than implementing a new one. So I’ll try to disable idle timer in C# via new new bridge.

Thanks,

I haven’t played with WP8’s idle detection mode yet.  So, I’m not sure if it can be turned on/off like iOS and Android.

You’ve got the shortest deadline compared to other WP8 beta developers here.  So, which issue do you think is more important for us to work on next?

Honestly, this event (screen locking) wouldn’t occur so often during my gameplay, although it might happen.

So yes, for me developing the Idle Timer feature would be more important, but I don’t want to alter your schedule again. I think I could stand that bug in the release version and update a fixed version later.

+1 this . I was about to ask the same thing. I have an auto mode on my game and for obvious reasons I need the idle timer on. I dont mind looking at the Lua Bridge method if I knew where to start. I could do with a mini- guide to doing that kind of thing which would also allow me to look at other bridging experiments too.

Fair enough.  I’ll jump on this feature later this week.

Olaf,

I’ve tested idle timer support out today.  WP8 definitely supports enabling and disabling multiple times within the same app session.  I proved it by setting up the device to turn off the screen when idle for 30 seconds and having a timer switch between enabling and disabling the idle timer every 1 minute.  Disabling the idle timer prevented the screen from turning off for 1 minute (as expected) and then re-enabling the idle timer made the screen turn off a short time later.  Turning the screen on and re-disabling the idle timer prevented the screen from shutting off for 1 minute again.  So, yeah, it definitely supports switching it back and forth.

If you want to do this for yourself in C#, then you can prevent the screen from turning off like this…

   PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;

And you can switch on idle detection mode like this…

   PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled;

I’ll go ahead and support for it later this week anyways.

Oh and idle detection mode is disabled by default when you run your app via Visual Studio’s “Managed” debugger.  You can see this in your “App.xaml.cs” file in its constructor.  This is the code that was generated by Microsoft’s WP8 project template.  Just warning you in case it causes confusion.  It caught me off guard at first.

OK, good to know! Since I’m uploading the new version anyway I’ll include this in C# as well. Thanks!

Hi is this available to use now? I tried running the Store test kit and while profiling  the app it turns off and fails.

You can disable idle timer using native/lua communication. Here you can follow examples on how to use it:

http://docs.coronalabs.com/daily/coronacards/wp8/index.html#lua-interop-communications

So you have to dispatch an event from lua and define the event listener in C# to call the native idle disabling method that Joshua mentioned above.

Rob,

We’ll push out another build next week having support for this.  But, you don’t have to wait.  You can do what “whammy” suggested and implement it yourself via our Native/Lua bridge and the code example I posted up above.

Would you prefer that we fix the 60 FPS text rendering issue first?

I’m thinking that’s a higher priority.  I’ve already started digging into the text issue today.

With our new Native/Lua bridge, you can disable the idle timer yourself in C#.  You can control this via Microsoft’s PhoneApplicationService class…

  http://msdn.microsoft.com/en-US/library/windows/apps/microsoft.phone.shell.phoneapplicationservice(v=vs.105).aspx

Just get a hold of an instance of this class via its static “Current” property and then set its “ApplicationIdleDetectionMode” property to disabled.  At least that’s how it works according to what I’ve read.  I’ll look into doing this later too, but I want to make sure that I resolve outstanding issues that you can’t solve/work-around on your end first.

“ApplicationIdleDetectionMode cannot be enabled after it has been disabled.”
Does it mean that for WP8 apps you can’t change this property back and forth like on iOS/Anroid?

Regarding the custom fonts lag - I’ve already changed all my multiline text to bitmap fonts to work around the bug, but I understand it’s more urgent to fix the existing feature than implementing a new one. So I’ll try to disable idle timer in C# via new new bridge.

Thanks,

I haven’t played with WP8’s idle detection mode yet.  So, I’m not sure if it can be turned on/off like iOS and Android.

You’ve got the shortest deadline compared to other WP8 beta developers here.  So, which issue do you think is more important for us to work on next?

Honestly, this event (screen locking) wouldn’t occur so often during my gameplay, although it might happen.

So yes, for me developing the Idle Timer feature would be more important, but I don’t want to alter your schedule again. I think I could stand that bug in the release version and update a fixed version later.

+1 this . I was about to ask the same thing. I have an auto mode on my game and for obvious reasons I need the idle timer on. I dont mind looking at the Lua Bridge method if I knew where to start. I could do with a mini- guide to doing that kind of thing which would also allow me to look at other bridging experiments too.

Fair enough.  I’ll jump on this feature later this week.

Olaf,

I’ve tested idle timer support out today.  WP8 definitely supports enabling and disabling multiple times within the same app session.  I proved it by setting up the device to turn off the screen when idle for 30 seconds and having a timer switch between enabling and disabling the idle timer every 1 minute.  Disabling the idle timer prevented the screen from turning off for 1 minute (as expected) and then re-enabling the idle timer made the screen turn off a short time later.  Turning the screen on and re-disabling the idle timer prevented the screen from shutting off for 1 minute again.  So, yeah, it definitely supports switching it back and forth.

If you want to do this for yourself in C#, then you can prevent the screen from turning off like this…

   PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;

And you can switch on idle detection mode like this…

   PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled;

I’ll go ahead and support for it later this week anyways.