Creating a Scheduled Task in windows phone - windows-phone-7

How can I repeat a particular task daily at a particular time in windows phone?I need to show a toast message to the user everyday at particular time.

Just use PeriodicTask class and configure it to run in background.
sample to check:
Windows Phone 8 Background Agent (Part 1: Periodic Task)

Related

How to detect the Task Scheduler trying to terminate a program due to the "Stop if the computer switches to battery power" option

Background
I am writing a PowerShell script that runs from Windows Task Scheduler and resides in the task tray.
Problem
When you create a new task in Task Scheduler, the option Start the task only if the computer is on AC power and Stop if the computer switches to battery power are on by default.
But I don't want to stop the script when the AC adapter is plugged off. So I want to detect the Task Scheduler trying to stop the script when it switches to battery power and let the user set these options off.
Question
In a PowerShell script, is there any way to detect the Task Scheduler trying to terminate the script due to the "Stop if the computer switches to battery power" option?
You can likely detect that it is has happened, but you can probably only stop it from happening by changing the options on the scheduled task.
There should be an entry in the Task Scheduler's event log when a task is stopped due to battery power switches, and another when tasks are not started due to not being on AC power.
Since I type this on a desktop, I don't have easy access to what those event IDs would be.
I'd create a test task and see what the event IDs are, and then, if you'd like, you could create a scheduled task that triggers on either of those events.

Perform Background tasks in windows 7 phone

In Android we have Services to perform background tasks what can we use to do same in Windows Phone ?
Background Agent
Scheduled Tasks and background agents allow an application to execute code in the background, even when the application is not running in the foreground.

Windows Phone Launchers and choosers

I had a couple of queries about the windows phone 7 launcher tasks, Specifically a phonecalltask.
1) Does PhonecallTask Show() launch an application?
2) If so, What happens to the calling application? Does it go dormant or run on separate threads?
Tasks shelve the currently running application and run the ms supplied apps to make calls, play videos, send sms, email etc.
When you are in a task it will "Tombstone" your application so that you can save the data you need for when it recovers.
Showing a PhoneCallTask can be compared to receiving a phone call while in your application.

windows phone app running in the background

Is it possible to create an app the runs in the background? If so is there any samples out there for this?
In Windows Phone OS 7.1 you can actually use Background Agents now to perform tasks in the background.
from MSDN:
Scheduled Tasks and background agents allow an application to execute
code in the background, even when the application is not running in
the foreground. The different types of Scheduled Tasks are designed
for different types of background processing scenarios and therefore
have different behaviors and constraints.
You can use a PeriodicTask or ResourceIntensiveTasks. Read more about it in the MSDN article above.
And here's some sample code for you to integrate background agents into your existing app.
Sample Code: Background Agents in Mango
An application in the foreground can continue to run when the phone screen is locked(not background but...) by setting the PhoneApplicationService.ApplicationIdleDetectionMode property. By setting up your application to run when the phone screen is locked, a user is able to access the application quickly upon unlock. However, when your application runs under a locked screen, it could consume power outside of the user's control. For this reason, your application must minimize power usage when running under a locked screen
At the moment there is no way to create application that runs in background.
True multitasking for 3rd party Windows Phone 7 apps will come as an OS upgrade later this year. However, unless the app has to absolutely run in the background (like Pandora etc.), we as developers share some responsibility in making our apps feel at home with the rest of the OS.
Windows Phone OS offers app developers chances to save state of their applications to give the end users the feeling that it never stopped running; this is essentially the same as in other mobile platforms. As your app is being deactivated/closed, you have the option to "Tombstone" your state so that your users can come back to just where they left with BackStack navigation or future launches. Channel 9 had a nice set of demos & labs around tombstoning, found here.
Hope this helps!

run command/script when lock/unlock windows station?

I have Windows 7 pro at work. My problem is I keep on forgetting to clock in/clock out (using the intranet timesheet system). Is there a way to run a script or command to automatically open the timesheet page each time I lock/unlock my station?
Yes, windows 7 task scheduler allows a dizzying array of new ways to schedule tasks:
One is on log on, and another is on event which could be a security event for locking the workstation.
Administrative Tools --> Task Scheduler
- Create Task
--> Triggers Tab
--> New Button
--> Begin Task drop down box...
etc.
You can use the trigger event "on workstation unlock"...or "on workstation lock", in Windows 10 task scheduler.

Resources