SlideShare a Scribd company logo
Real World State and Notification BrokerMichele LocuratoloIn collaborazione con
AgendaWhat is the State and Notification BrokerReading a System StateReacting to changesApplication launcher
What is the State and Notification Broker:Il a set of API which allow developers to:Monitoring the System State in managed code:We have more then 100 states exposedReact on system state changesCreate custom states
Now we have:A consistent model to access and manage the system statesNo P/Invoke! 100% Managed code!A lot of states exposed (more then 100)
A BIG difference
Read the battery stateDEMO
Reacting to a changesCreate an instance of the specific stateRegister to the .Changes eventImplement your code 
React to the battery state changesDEMO
How we can use it (in a real world scenario)?We can:Disable  buttons /menu when the battery strength is lowSend data before battery goes down…
ActiveSyncStatusPhoneCallForwardingOnLine1CradlePresentMessagingMmsUnreadMessagingOtherEmailUnreadMessagingLastEmailAccountNameMessagingTotalEmailUnreadPhoneLastIncomingCallerNameMediaPlayerTrackGenreMediaPlayerTrackTitleHeadsetPresentPhoneIncomingCallerNumberConnectionsVpnDescriptionsMessagingSmsUnreadPhoneIncomingCallerNameKeyboardPresentPhoneSimFullWiFiStateConnectedMessagingVoiceMailTotalUnreadOwnerNameConnectionsProxyCountPhoneCallOnHoldPhoneActiveCallCountMediaPlayerTrackArtistWiFiStatePowerOnTasksActivePhoneMissedCallCalendarEventBusyStatusMessagingActiveSyncAccountNameDisplayRotationPhoneCallCallingPhoneCallBarringPhoneActiveDataCallCameraPresentPhoneBlockedSimPhoneIncomingCallerContactPhoneGprsCoverageWiFiStateNetworksAvailablePhoneMissedCallsConnectionsCountPhone1xRttCoverageTasksHighPriorityPhoneIncomingCallerContactPropertyName
Behind the scenes:The Windows Mobile Registry is the central repository:SystemState: for the predefined statesRegistryState: for the custom  state
Creating your own state:Crate an instance of the RegistryState ClassReact to the changes like the classic SystemState
Create your own stateDEMO
Application LauncherStart an application when a monitored state changesStateBase implements IApplicationLaucher interfaceThe IApplicationLaucher has the capability to start an applicationInformation about the application to start are stored in the Registry
ApplicationLauncherDEMO
RemarksYou can start directly when a state changes…SystemStatemonitoredState = newSystemState(SystemProperty.PowerBatteryBackupStrength);monitoredState.EnableApplicationLauncher("MyCoolApp");…or when a state arrives to a specified valueSystemStatemonitoredState = new SystemState(SystemProperty.PowerBatteryBackupStrength);monitoredState.ComparisonType = StatusComparisonType.Less;monitoredState.ComparisonValue = BatteryLevel.Low;monitoredState.EnableApplicationLauncher("MyCoolApp");The second application is not running before the state value doesn’t match with the criteria
In conclusion….Windows Mobile exposes more then 100 different statesWhen you need to interact with any kind of system notifications, check the System StatesYou can create your own stateUse the S&N API to produce a better softwareCheck out this open source application which uses this APIshttp://www.codeplex.com/MobilePhoneAssistant
ActiveSyncStatusPhoneCallForwardingOnLine1CradlePresentMessagingMmsUnreadMessagingOtherEmailUnreadMessagingLastEmailAccountNameMessagingTotalEmailUnreadPhoneLastIncomingCallerNameMediaPlayerTrackGenreMediaPlayerTrackTitleHeadsetPresentPhoneIncomingCallerNumberConnectionsVpnDescriptionsMessagingSmsUnreadPhoneIncomingCallerNameKeyboardPresentPhoneSimFullWiFiStateConnectedMessagingVoiceMailTotalUnreadOwnerNameConnectionsProxyCountPhoneCallOnHoldPhoneActiveCallCountMediaPlayerTrackArtistWiFiStatePowerOnTasksActivePhoneMissedCallCalendarEventBusyStatusMessagingActiveSyncAccountNameDisplayRotationPhoneCallCallingPhoneCallBarringPhoneActiveDataCallCameraPresentPhoneBlockedSimPhoneIncomingCallerContactPhoneGprsCoverageWiFiStateNetworksAvailablePhoneMissedCallsConnectionsCountPhone1xRttCoverageTasksHighPriorityPhoneIncomingCallerContactPropertyName
Link17/01/2008www.xedotnet.org19Michele Locuratolohttp://www.michelelocuratolo.commichele@locuratolo.comhttp://www.michelelocuratolo.comTwitter.com/mighell

More Related Content

PPT
TuAnalyze screenshots
PPTX
Design patterns
PPTX
Slverlight Networking (Andrea Boschin)
PPTX
ASP.NET 4.0
PPTX
Codice di qualità con VS2010 (TDD)
PPTX
Windows Embedded, Segreti E Misteri Delle Piattaforme
PPTX
Silverlight 4
TuAnalyze screenshots
Design patterns
Slverlight Networking (Andrea Boschin)
ASP.NET 4.0
Codice di qualità con VS2010 (TDD)
Windows Embedded, Segreti E Misteri Delle Piattaforme
Silverlight 4

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Mushroom cultivation and it's methods.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
A Presentation on Touch Screen Technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Approach and Philosophy of On baking technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
August Patch Tuesday
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Enhancing emotion recognition model for a student engagement use case through...
Hindi spoken digit analysis for native and non-native speakers
A novel scalable deep ensemble learning framework for big data classification...
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
NewMind AI Weekly Chronicles - August'25-Week II
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Mushroom cultivation and it's methods.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A Presentation on Touch Screen Technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TLE Review Electricity (Electricity).pptx
Approach and Philosophy of On baking technology
MIND Revenue Release Quarter 2 2025 Press Release
August Patch Tuesday
Programs and apps: productivity, graphics, security and other tools
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Group 1 Presentation -Planning and Decision Making .pptx
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Ad
Ad

Real World State And Notification Broker

Editor's Notes

  • #3: Chiedere quanti conoscono S&N e quanti lo hanno già usato
  • #5: In the past, system states non exposedasmanagedP/InvokesrequiredInconsistentAPIstoretrieve System States
  • #6: Marcare sulla congruenza del modello di accesso agli stati
  • #7: Battery: semplice lettura di uno stato
  • #9: Battery
  • #10: Dire alla fine:Remember…we have more than 100 states
  • #12: HKLMSystemState: general stateHKCUSystemState: user state (likeappointments)Mostrare il registro con Remote RegistryEditor
  • #14: Battery
  • #15: PersistentNotificationThe previuos (and verysimple) demo helps me to introduce the PersistentNotification.
  • #16: Battery
  • #17: Sulpunto 1, fare l’esempiodellechiamateentranti e che è possibileavviareil software solo se un determinatochiamantestàchiamando!