1
votes

It seems that

PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;

is no longer available in Windows Phone 8.1 (non-Silverlight). Is there a way to get app running under lock screen like playing audio but for our own purpose like performing time consuming image, video processing in the background?

From official documentation such as https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn642090.aspx, I sort of guess that from 8.1 running stuffs under lock screen is privilege of Microsoft's stock apps and that developers are limited to whatever they are supplying. For e.g. third party apps can only playing audio via MediaPlayer API and download/upload files via Background transfer in background. I could guess the intention is to rein rogue apps and conserve battery; but this forces genuine apps and users to keep the screen on and this drains battery even more.

1

1 Answers

2
votes

As far as I know it's not possible to run your app (main part) under lockscreen. As soon as lockscreen is engaged, your app will be suspended (see more at MSDN).

If you want to prevent from auto-lockscreen you can use DisplayRequest class.

Note that when your app perform a long running operatin (also probably consuming battery) the user should have possiblity to cancel/monitor the process.

As for running code in background in WinRT it is possible: