SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Real World State and Notification Broker Michele Locuratolo In collaborazione con
Agenda What is the State and Notification Broker Reading a System State Reacting to changes Application 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 exposed React on system state changes Create custom states
Now we have: A consistent model to access and manage the system states No P/Invoke! 100% Managed code! A lot of states exposed (more then 100)
A BIG difference
Read the battery state DEMO
Reacting to a changes Create an instance of the specific state Register to the .Changes event Implement your code 
React to the battery state changes DEMO
How we can use it (in a real world scenario)? We can: Disable  buttons /menu when the battery strength is low Send data before battery goes down …
ActiveSyncStatus PhoneCallForwardingOnLine1 CradlePresent MessagingMmsUnread MessagingOtherEmailUnread MessagingLastEmailAccountName MessagingTotalEmailUnread PhoneLastIncomingCallerName MediaPlayerTrackGenre MediaPlayerTrackTitle HeadsetPresent PhoneIncomingCallerNumber ConnectionsVpnDescriptions MessagingSmsUnread PhoneIncomingCallerName KeyboardPresent PhoneSimFull WiFiStateConnected MessagingVoiceMailTotalUnread OwnerName ConnectionsProxyCount PhoneCallOnHold PhoneActiveCallCount MediaPlayerTrackArtist WiFiStatePowerOn TasksActive PhoneMissedCall CalendarEventBusyStatus MessagingActiveSyncAccountName DisplayRotation PhoneCallCalling PhoneCallBarring PhoneActiveDataCall CameraPresent PhoneBlockedSim PhoneIncomingCallerContact PhoneGprsCoverage WiFiStateNetworksAvailable PhoneMissedCalls ConnectionsCount Phone1xRttCoverage TasksHighPriority PhoneIncomingCallerContactPropertyName
Behind the scenes: The Windows Mobile Registry is the central repository: SystemState: for the predefined states RegistryState: for the custom  state
Creating your own state: Crate an instance of the RegistryState Class React to the changes like the classic SystemState
Create your own state DEMO
Application Launcher Start an application when a monitored state changes StateBase implements IApplicationLaucher interface The IApplicationLaucher has the capability to start an application Information about the application to start are stored in the Registry
ApplicationLauncher DEMO
Remarks You can start directly when a state changes… SystemStatemonitoredState = newSystemState(SystemProperty.PowerBatteryBackupStrength); monitoredState.EnableApplicationLauncher("MyCoolApp"); …or when a state arrives to a specified value SystemStatemonitoredState = 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 states When you need to interact with any kind of system notifications, check the System States You can create your own state Use the S&N API to produce a better software Check out this open source application which uses this APIs http://www.codeplex.com/MobilePhoneAssistant
ActiveSyncStatus PhoneCallForwardingOnLine1 CradlePresent MessagingMmsUnread MessagingOtherEmailUnread MessagingLastEmailAccountName MessagingTotalEmailUnread PhoneLastIncomingCallerName MediaPlayerTrackGenre MediaPlayerTrackTitle HeadsetPresent PhoneIncomingCallerNumber ConnectionsVpnDescriptions MessagingSmsUnread PhoneIncomingCallerName KeyboardPresent PhoneSimFull WiFiStateConnected MessagingVoiceMailTotalUnread OwnerName ConnectionsProxyCount PhoneCallOnHold PhoneActiveCallCount MediaPlayerTrackArtist WiFiStatePowerOn TasksActive PhoneMissedCall CalendarEventBusyStatus MessagingActiveSyncAccountName DisplayRotation PhoneCallCalling PhoneCallBarring PhoneActiveDataCall CameraPresent PhoneBlockedSim PhoneIncomingCallerContact PhoneGprsCoverage WiFiStateNetworksAvailable PhoneMissedCalls ConnectionsCount Phone1xRttCoverage TasksHighPriority PhoneIncomingCallerContactPropertyName
Link 17/01/2008 www.xedotnet.org 19 Michele Locuratolo http://www.michelelocuratolo.com michele@locuratolo.com http://www.michelelocuratolo.com Twitter.com/mighell

Weitere ähnliche Inhalte

Ähnlich wie Real World State And Notification Broker

C:\documents and settings\student\desktop\swaroop uml
C:\documents and settings\student\desktop\swaroop umlC:\documents and settings\student\desktop\swaroop uml
C:\documents and settings\student\desktop\swaroop uml
satyaiswaroop
 
Observer Pattern Khali Young 2006 Aug
Observer Pattern Khali Young 2006 AugObserver Pattern Khali Young 2006 Aug
Observer Pattern Khali Young 2006 Aug
melbournepatterns
 

Ähnlich wie Real World State And Notification Broker (20)

Programming models for event controlled programs
Programming models for event controlled programsProgramming models for event controlled programs
Programming models for event controlled programs
 
Unit 4- State Machine in mobile programming
Unit 4- State Machine in mobile programmingUnit 4- State Machine in mobile programming
Unit 4- State Machine in mobile programming
 
Jetpack Compose untuk UI Masa Depan Bagian 2 - Sidiq Permana
Jetpack Compose untuk UI Masa Depan Bagian 2 - Sidiq PermanaJetpack Compose untuk UI Masa Depan Bagian 2 - Sidiq Permana
Jetpack Compose untuk UI Masa Depan Bagian 2 - Sidiq Permana
 
Rise of state_machines
Rise of state_machinesRise of state_machines
Rise of state_machines
 
Write better, stronger, faster behat steps with ScenarioStateBehatExtension
Write better, stronger, faster behat steps with ScenarioStateBehatExtensionWrite better, stronger, faster behat steps with ScenarioStateBehatExtension
Write better, stronger, faster behat steps with ScenarioStateBehatExtension
 
State transition testing-software_testing
State transition testing-software_testingState transition testing-software_testing
State transition testing-software_testing
 
Reducers+flux=redux
Reducers+flux=reduxReducers+flux=redux
Reducers+flux=redux
 
React state
React  stateReact  state
React state
 
Seminar State Chart1
Seminar State Chart1Seminar State Chart1
Seminar State Chart1
 
STATE DIAGRAM.pptx
STATE DIAGRAM.pptxSTATE DIAGRAM.pptx
STATE DIAGRAM.pptx
 
Lagom - Persistent Entity
Lagom - Persistent EntityLagom - Persistent Entity
Lagom - Persistent Entity
 
Introduction to State Machines
Introduction to State MachinesIntroduction to State Machines
Introduction to State Machines
 
Reduxing UI: Borrowing the Best of Web to Make Android Better
Reduxing UI: Borrowing the Best of Web to Make Android BetterReduxing UI: Borrowing the Best of Web to Make Android Better
Reduxing UI: Borrowing the Best of Web to Make Android Better
 
Software System Engineering - Chapter 14
Software System Engineering - Chapter 14Software System Engineering - Chapter 14
Software System Engineering - Chapter 14
 
C:\documents and settings\student\desktop\swaroop uml
C:\documents and settings\student\desktop\swaroop umlC:\documents and settings\student\desktop\swaroop uml
C:\documents and settings\student\desktop\swaroop uml
 
What 100M downloads taught us about iOS architectures
What 100M downloads taught us about iOS architecturesWhat 100M downloads taught us about iOS architectures
What 100M downloads taught us about iOS architectures
 
Observer Pattern Khali Young 2006 Aug
Observer Pattern Khali Young 2006 AugObserver Pattern Khali Young 2006 Aug
Observer Pattern Khali Young 2006 Aug
 
Declarative presentations UIKonf
Declarative presentations UIKonfDeclarative presentations UIKonf
Declarative presentations UIKonf
 
States, state graphs and transition testing
States, state graphs and transition testingStates, state graphs and transition testing
States, state graphs and transition testing
 
Software engineering rogers pressman chapter 7
Software engineering rogers pressman chapter 7Software engineering rogers pressman chapter 7
Software engineering rogers pressman chapter 7
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Real World State And Notification Broker

  • 1. Real World State and Notification Broker Michele Locuratolo In collaborazione con
  • 2. Agenda What is the State and Notification Broker Reading a System State Reacting to changes Application launcher
  • 3. 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 exposed React on system state changes Create custom states
  • 4. Now we have: A consistent model to access and manage the system states No P/Invoke! 100% Managed code! A lot of states exposed (more then 100)
  • 6. Read the battery state DEMO
  • 7. Reacting to a changes Create an instance of the specific state Register to the .Changes event Implement your code 
  • 8. React to the battery state changes DEMO
  • 9. How we can use it (in a real world scenario)? We can: Disable buttons /menu when the battery strength is low Send data before battery goes down …
  • 10. ActiveSyncStatus PhoneCallForwardingOnLine1 CradlePresent MessagingMmsUnread MessagingOtherEmailUnread MessagingLastEmailAccountName MessagingTotalEmailUnread PhoneLastIncomingCallerName MediaPlayerTrackGenre MediaPlayerTrackTitle HeadsetPresent PhoneIncomingCallerNumber ConnectionsVpnDescriptions MessagingSmsUnread PhoneIncomingCallerName KeyboardPresent PhoneSimFull WiFiStateConnected MessagingVoiceMailTotalUnread OwnerName ConnectionsProxyCount PhoneCallOnHold PhoneActiveCallCount MediaPlayerTrackArtist WiFiStatePowerOn TasksActive PhoneMissedCall CalendarEventBusyStatus MessagingActiveSyncAccountName DisplayRotation PhoneCallCalling PhoneCallBarring PhoneActiveDataCall CameraPresent PhoneBlockedSim PhoneIncomingCallerContact PhoneGprsCoverage WiFiStateNetworksAvailable PhoneMissedCalls ConnectionsCount Phone1xRttCoverage TasksHighPriority PhoneIncomingCallerContactPropertyName
  • 11. Behind the scenes: The Windows Mobile Registry is the central repository: SystemState: for the predefined states RegistryState: for the custom state
  • 12. Creating your own state: Crate an instance of the RegistryState Class React to the changes like the classic SystemState
  • 13. Create your own state DEMO
  • 14. Application Launcher Start an application when a monitored state changes StateBase implements IApplicationLaucher interface The IApplicationLaucher has the capability to start an application Information about the application to start are stored in the Registry
  • 16. Remarks You can start directly when a state changes… SystemStatemonitoredState = newSystemState(SystemProperty.PowerBatteryBackupStrength); monitoredState.EnableApplicationLauncher("MyCoolApp"); …or when a state arrives to a specified value SystemStatemonitoredState = 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
  • 17. In conclusion…. Windows Mobile exposes more then 100 different states When you need to interact with any kind of system notifications, check the System States You can create your own state Use the S&N API to produce a better software Check out this open source application which uses this APIs http://www.codeplex.com/MobilePhoneAssistant
  • 18. ActiveSyncStatus PhoneCallForwardingOnLine1 CradlePresent MessagingMmsUnread MessagingOtherEmailUnread MessagingLastEmailAccountName MessagingTotalEmailUnread PhoneLastIncomingCallerName MediaPlayerTrackGenre MediaPlayerTrackTitle HeadsetPresent PhoneIncomingCallerNumber ConnectionsVpnDescriptions MessagingSmsUnread PhoneIncomingCallerName KeyboardPresent PhoneSimFull WiFiStateConnected MessagingVoiceMailTotalUnread OwnerName ConnectionsProxyCount PhoneCallOnHold PhoneActiveCallCount MediaPlayerTrackArtist WiFiStatePowerOn TasksActive PhoneMissedCall CalendarEventBusyStatus MessagingActiveSyncAccountName DisplayRotation PhoneCallCalling PhoneCallBarring PhoneActiveDataCall CameraPresent PhoneBlockedSim PhoneIncomingCallerContact PhoneGprsCoverage WiFiStateNetworksAvailable PhoneMissedCalls ConnectionsCount Phone1xRttCoverage TasksHighPriority PhoneIncomingCallerContactPropertyName
  • 19. Link 17/01/2008 www.xedotnet.org 19 Michele Locuratolo http://www.michelelocuratolo.com michele@locuratolo.com http://www.michelelocuratolo.com Twitter.com/mighell

Hinweis der Redaktion

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