March 1, 2011, 23:23
Are you looking for a tool that periodically pings a list of hosts? Here is a toolset that will reschedule a ping utilitiy. This ping utility pings a list of hosts and will create notifications if one or most hosts failed to answer.
I have done this toolset with three separate applications. The scheduler and the notification tool are written in C/C++ win32 API cause this API provided the best access to all the possibilities of the used functions. The user notification API is only supported with basic functionality by CF2. The CEUserNotification API is not supported by CF2 at all.
Although OpenNetCF provides an C# interface to the used APIs, I did not like to include all the unneeded stuff. On the other hand the scheduler is fast and small written in C/C++. With C# I had problems with the notification, especially for removing existing notifications and why should the main tool reside in memory just for showing the notification.
The ping tool is written in C# targeting Compact Framework 2. C# was the easiest to implement the GUI.
All source is available thru one Visual Studio 2008 solution. Yes, you can mix C/C++ and CF2 within one solution.
Continue reading ‘Mobile Development-PingAlert: watch your servers’ »
July 14, 2009, 14:55
Hello
for some reason you might want to rerun an application very day or every hour. In commercial applications, one may want to let the device sync data every 4 hours, So you need an application that runs periodically at specified times or intervals. As this first sounds easy, it is not as simple as you mean.You cannot simply use timers, timers will not continue to run within Suspend mode.
To have an application run at specific times, Windows Mobile supports a notification database. Your device will already wake up periodically to reschedule events and to clean up the notification database. Normally, Windows Mobile Phone devices will awake every night at 0:00.
There are also some other possible notifications that can launch an application, see my old web site.
How can we do a scheduled application ourself? At first run, the scheduler application has to delete all previous notification entries of the notification database. Then it has to create a new timed notification and in our sample, it will then launch another application. The scheduler application itself should be small and only care about the schedules. The worker application can be what you want and will be started by the scheduler application.
Continue reading ‘Howto run an application periodically’ »
Tags:
notification,
periodically,
power state,
resume,
schedule,
SetPowerRequirement,
SetSystemPowerState,
suspend,
SystemIdleTimerReset,
thread,
timer Category:
CodeProject,
Programming |
Comments Off on Howto run an application periodically