Std_Net
Std_Net

Reputation: 1096

WP8 timer app under lock screen

I have app with dispatcher timer. User set some interval(for example 30 sec) and press button start. App Each 30 sec play sound. All work ok. But when User lock phone timer stopped and nothing played. Can I play sound each 30 sec when phone is locked?

Upvotes: 1

Views: 1555

Answers (2)

anderZubi
anderZubi

Reputation: 6424

It is possible to keep the app running under lock screen.

Using Idle Detection, you can keep the app on, although screen is locked. Actually, it is not running in background, but in the foreground. Just the screen is locked. So, be careful not to drain user's battery.

You have to set the PhoneApplicationService.ApplicationIdleDetectionMode property to Disabled, for example in InitializePhoneApplication() method in App.xaml.cs:

PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;

Note that there are special certification requirements for this type of apps. Refer to section 6.3 (Apps running under a locked screen) of the following page:

Additional requirements for specific app types for Windows Phone

Upvotes: 5

Nikhil Prajapati
Nikhil Prajapati

Reputation: 942

yes. sure.. You can use the Scheduled Task Agent in windows phone.

using the Scheduled Task Agent, when you app is not running or stopped (not in background). you can fire your Events.

For that you have to add the scheduled task agent into your project. And in the ScheduledAgent.cs file find the OnInvoke method and put your code here. this method performs the task in Background. (Means the code is executed when your phone is locked).

for more Reference click here Implement background agents for Windows Phone

I hope you get the destination. Now, just put that code into your application and its working.

Upvotes: 1

Related Questions