Question

i used this code for my windows phone app.

Settings = new dmWFSettings();
Settings.TilePeriodicTask = 
    ScheduledActionService.Find("eWorkflow") as PeriodicTask;

if (Settings.TilePeriodicTask != null)
{
    Settings.TilePeriodicTaskEnabled = Settings.TilePeriodicTask.IsEnabled;
    try
    {
        ScheduledActionService.LaunchForTest(
            Settings.TilePeriodicTask.Name, new TimeSpan(0, 0, 2));
    }
    catch (Exception)
    {
    }
}

but now for the tablet(RT) version what is the replacement for the ScheduledActionService , call ?

Thanks,

Was it helpful?

Solution

The thing you are looking for is called "Background Tasks" in Windows RT world.

First of all, have a look at MSDN: http://msdn.microsoft.com/en-us/library/windows/apps/hh977056.aspx You will find some examples and API reference there.

Some points that aren't stated clearly enough in MSDN:

  • To have background tasks you must indicate that you are lock-screen-capable and have a lock screen badge (though you don't have to actually display one)
  • You'd better implement your IBackgroundTask in a separate assembly which has to be a Windows Runtime Component, not just plain old class library. Failing to do so will put you into the world of cryptic and meaningless error messages.
  • You may not call BackgroundExecutionManager.RequestAccessAsync if you don't really want to show anything on lock screen. You may schedule background tasks without asking user permission if that tasks wouldn't show notifications or do something UI-related.
  • Have a look here when you start debugging: http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2012/11/13/windows-8-store-apps-debugging-background-tasks.aspx
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top