In my app, I've created the mechanism to create a custom tile. Lets say, CreateTile() this is the function which will create live tile and also will update the value.
But I want to update the live tile automatically every one minute. I have heard of Background Task Agent and Scheduled Notifications. But I don't know how to use them.
Can anyone help me out, assuming that there is already a function CreateTile() which updates my tile information?
Periodic background agents run at roughly 30 minutes interval. You cannot configure this interval.
Here are the details for background agents: Background agents for Windows Phone 8
Related
I create a ThreadPoolTimer to refresh my token(which will expire in 12 hours), and the timer is expected to be ticked in 12 hours. However, I put my UWP app in background over 12 hours, and then resume the app, the timer is not ticked even though the token is expired. Seems that when the app is background, the ThreadPoolTimer is also suspended. I tried DispatcherTimer, which is not suspended when the app is in background, however it's only available in UI thread. Is there any replacement Timer in UWP can meet my requirement?
This is normal behavior - when the app is suspended, all it's processes are being stopped - take a look at App's Lifecycle.
Your scenario - to run code in 12h interval, fits BackgroundTask with TimeTrigger. Take a look at MSDN and there is also a sample.
Once I've also written a blog post about running such task - maybe will help. Also take a look at this answer at SO.
I am Creating a Reminder wpf application where user can select time, repeat type and seta reminder on his machine.
Based on his inputs I would like to add scheduled task. I need some help how to accomplish this using taskscheduler.(Nudget package) or if any other alternative.
I want to pop up a reminder window which I would create in my wpf application.
The Execute method of TaskScheduler allows triggering exe files.
But how to open my reminder window as a trigger action?
Please help...!
I did this long time ago, but I guess to setup the task we had one project and to show message we had another one.
Have a look here to see how to create a task, and in ExecAction provide path to your other application(pop up one)
My customer wants to set time (ex: Dec 13, 16:00 pm) to run a certain task.
I dont think cron job fits for it because customer dont know how to use google app engine SDK.
Is there any other way to do it?
Thanks
You can create a task and set the time when you want this task to be executed. From the documentation:
X-AppEngine-TaskETA, the target execution time of the task, specified
in milliseconds since January 1st 1970.
You can use the task queue API: https://cloud.google.com/appengine/docs/python/taskqueue/ or even the defer API: https://cloud.google.com/appengine/articles/deferred
If your customer is a user of your application, and there may be several users requesting tasks to be executed at different times, then you can save these requests to the datastore. Create a cron job to run every hour (or however precise you need the timeframe) which checks the datastore to see if there are any tasks to run at that time - if so, run the proper script.
If this is just a one-time, or small number of tasks, you can do as Andrei suggested.
In my Windows 8 metro style app, I want to update tile in every second. Is it Possible in WinRt apps? Please give me a solution for this issue
The rate at which app tiles are refreshed is determined by the OS and cannot be influenced by the app. Background tasks are limited to running once every 15 minutes and the BadgeUpdater can only be scheduled every 30 minutes.
See http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.notifications.periodicupdaterecurrence.aspx for more information.
This might be closer to what you are expecting to do.
Here's a solution for every minute (not second):
Tile Update every minute
I have a requirement where I need to show a Lock screen , when the app remains idle for certain period of time. In WP7 is there any way to get the Idle time(Any OS APIs). I have gone through MSDN documentation of PhoneApplicationService.UserIdleDetectionMode and PhoneApplicationService.ApplicationIdleDetectionMode but it is just for enabling and disabling.I need some method by which I can get the Idle time. Thanks in Advance
To my knowledge, there isn't a way of doing that in the current API version.
You could implement a timer in your application and reset it every time there is an user interaction (with your controls) within your application.
The bigger question is how you should handle the OS lock screen? I mean, if your application has an in-app custom lock screen that has kicked in, and then the OS lock screen kicks in, then the user has to unlock 2 screens. Not especially user friendly in that case.