Friday, October 21, 2005 10:57 AM
Sandeep Prabhakar
Plugging into Events that happen on a device in managed code
One of the most common requirements of a well written mobile application is to be network aware. For instance, as an app how do I determine if I am in the signal range of a GPRS network?
There's this cool managed class that exposed in the windows mobile 5.0 SDK that offers a ton of properties that you can hook event handlers on. Thus for instance when you come in the range of the GPRS network, poof an event is fired and you code that needs to do some network operation is called.
Hooking in the event handler for getting an event on a GPRS network becoming available is as follows:
SystemState state = new SystemState(SystemProperty.PhoneGprsCoverage);
state.Changed += new ChangeEventHandler(state_Changed);
Check out the information in the SDK for all the events that can happen on a device and how you can plug into those events.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/T_Microsoft_WindowsMobile_Status_SystemState.asp
This posting is provided "AS IS" with no warranties, and confers no rights.