The sample works great in the emulator but when I try to run it on my Lumia 1020 running 8.10.14157.200 it doesn't work. I tried the SampleBackgroun
dTask and SampleBackgroun dTaskWithCondit ion (as they are the easiest to trigger quickly) with the TimeZoneChange event, as well as UserAway, NetworkStateCha nge, etc... but it never updates the progress like it does in the emulator.
Hi, This example work fine for me.But i see in the code , we need to regist backgroud task by clicking on button register.So it mean we need to launch the app and click on button to regist. is there a way when we install app then it automatic to regist backgroud task ? Thanks in advance.
Hi Le Huu. There currently no way to register background tasks at application install time.
In the C# code snippet in the background tasks doc, it is missing the "myTaskBuilder.
SetTrigger(myT rigger);" line. The snippet has the the TimeTrigger in it. This is a follow up to my other post "does not fire the TimeTrigger" which Bob Bao is looking into. Also, if there is a better way to test a TimeTrigger, other than wait 15 minutes, that would be very useful. For example, it could fire once within a minute and 15 minutes afterward. This would help debugging a lot.
Hi RobHogue, You can start a registered background task earlier than 15 minutes on Visual Studio. Start your app, let it register the task, and open a menu where probably its current item is "Suspend", next to the Process information. Click the downarrow and you should see your task name on the menu. Just click on it to run!
Hi, I am using background task in C# development environment when i start my app the Run method inside the class is not fired, in the manifest i define the settings like : <Extensions> <Extension Category="windo
ws.backgroundTa sks" EntryPoint="Bac kgroundTaskWork er.LocationBack groundTask"> <BackgroundTask s> <Task Type="timer" /> </BackgroundTas ks> </Extension> </Extensions> My Run method is inside my LocationBackgro undTask class , and the control is not coming in this class to hit the Run method.
always followed this procedure.
Hi as it is defined in the sample i proceed with that way so my problem is very first time when we are registering the background task its registering and hitting the Run method also but not consistently, i run the sample for Geo Location Tracking inside that when the app is suspended in background we are tracking the location so in sample also the Run method is not fired consistently so i am unable to track the location If u have any idea please share ?
Did everything exactly as in the whitepaper, ran the c# code, registered the task in the sample, set the task on the lock screen as a background task, changed the UTC time zone and waited both at the lock screen and logged in. Nothing happened. What is meant to happen, am I meant to get a notification, popup, update on the notification sample screen? Has anyone got this to work and if so how did you know?
Task.js and name FacebookBackgro undTask has been unregistered because the entry point no longer exists in the task's application package. Any ideas? I have my js\fbBackground Task.js in the application manifest pointing to the entry point, and set as the 'start page' for a timer event (I want to run this every x mins - is it true the minimum you can set is 15 mins?!). Any ideas what this message means?
if you're going to have VB samples, at least test them for some functionality. I read the whole whitepaper on background tasks trying to figure out what was wrong, and then noticed that UpdateBackgroun
dTaskUI is using IS to compare two strings. It does seem to work if we use = instead.
Hi Dave, Which version of the sample are you looking at? I downloaded the one located above and I no longer see a "UpdateBackgrou
ndTaskUI" method in the implementation.
I have downloaded this sample application for C++. I launched the sample application from Visual Studio-11 on Win8. In the application UI, I select "1) Sample background task" and then click "Register". This mentions "Registers a background task for the Time Zone Change system event. The background task runs whenever the Time Zone changes." After this I go to the Desktop and then select "Change date and time settings..." and then change the Time Zone and press "OK". How do I know that the background task is launched? I do not see any application getting launched after I press "OK" for Time Zone change. If I go back to the sample application, I do not see any update on the UI as well. Is the background task logging any information somewhere? How do I know that?
Hi Himanshu, A couple things that you should be able to use to troubleshoot your problem. 1. Ensure that when you change your timezone you change to one that has a different UTC offset. The task will only fire if the system clock changes due to the time zone change. 2. You can set breakpoints in the Tasks::SampleBa
ckgroundTask.Ru n method to verify that they are running, you should also see UI updates in the output portion of the sample from progress and completion callbacks.
Can C++ be used for creating a background task? Should a background task object be implemented as a WinRT component? Is there anything that is different for C++ implementations that should be noted? Thanks
The answer to my own question is yes to build a background task object in C++ you create a WinRT component and implement the IBackgroundTask
I have written a short article on how to do it in C++ http://progmar.
wordpress.com/2 012/01/30/backg round-task-samp le-in-c/