44. Push Notifications: Data Flow Tile Push client Toast Open push channel Return URI Data to App Data to toast Data to tile App Send URI to server Send push data to client Your service Push service Send push data to URI Event 35
56. KEY TAKE-AWAYS There’s tons of new stuff to try out This is a first-class mobile platform The sky is now the limit Use your imagination, and get coding! HTTP://CREATE.MSDN.COM
The small slice represents what we know so far. There’s plenty more coming.
There are over 1,500 new APIs available to us in the next version of Windows Phone development. They range from new access to the camera all the way to manipulating tiles on the Start screen. This is just a small, small sampling.
There are over 1,500 new APIs available to us in the next version of Windows Phone development. They range from new access to the camera all the way to manipulating tiles on the Start screen. This is just a small, small sampling.
DEMOS TO DO:RawSensorDataSampleAugmentedRealityMotionSample
DEMOS TO DO:ExecutionModelSampleYou can also show Fast App Switching by holding down the F1 key inside the emulator. Load up a few applications, and then you can return to any of them by scrolling in the list.
DEMOS TO DO:BackgroundAudioPlayerSampleReminderSample
Integrated Experiences:The market for Windows Phone 7 consists of consumers with both a personal life and a business lifeThe phone works great in the customer’s personal life as well as in their business lifeIntegrated Office functionality creates great experiences for business usePictures and Multimedia experiences are great for personal useGetting applications on the phone for end users is easy through MarketplaceDelivering applications to Marketplace is easy for Developers
There are three different ways to retrieve location on the phone:GPSLocation information very accurateRadio drains significant powerInitial reading slow (especially if the device has been moved over a long distance without GPX fixes)Does not work indoorsCell Tower LookupNot that accurate (depends on the distance between cell towers)No additional power requirements (assuming the phone radio is switched on already)Fast location retrieval (if the phone radio is switched on, you are already connected to tower(s))No 100% coverageWiFi LookupIn between GPS and Cell Tower in both accuracy, speed and battery consumptionWorks pretty good in larger citiesIndependent of physical location retrieval, one consistent API is used inside your application.The cloud can help getting more accurate location readings, based on other people having been at the same location (without the need for enabling GPS on a particular, individual device)Location services do not only retrieve Lat/Long readings, but can also resolve address information through reverse geocoding services.
DEMOS TO DO:RawSensorDataSampleAugmentedRealityMotionSample
Integrated Experiences:The market for Windows Phone 7 consists of consumers with both a personal life and a business lifeThe phone works great in the customer’s personal life as well as in their business lifeIntegrated Office functionality creates great experiences for business usePictures and Multimedia experiences are great for personal useGetting applications on the phone for end users is easy through MarketplaceDelivering applications to Marketplace is easy for Developers
DEMOS TO DO:BasicCameraSampleCameraGrayscaleSample
There are three types of push notifications that you can use on a Windows PhoneNotifications that show up when your application is not running:Tile UpdateToast NotificationNotification that show up when your application is running:Possibility to immediately update your UITile UpdateImagine an application that gets photo feeds, for instance from a service like flickr. Currently the tile shows there are 14 pictures available[Animate]Something happens on the backend: new pictures become available. Through push notifications the tile can be updated[Animate]Toast NotificationImagine a weather application. The user has indicated that they want to be informed about weather updates. Currently the user is not using the weather application though.[Animate]You can send a toast to the device. It appears on the screen, regardless of what the user is doing on the device. If the user clicks on the toast, your application will be launched.[Animate]Push Notification while your application is runningInstead of polling for changes, you setup a push notification (meaning your application will wait for something to happen on the backend with no polling necessary). When something happens on the backend, the server will ping your application.[Animate]The application can take immediate action, for instance to display a newly received message to the user.
DEMOS TO DO:TileSample
Push notifications are a way to offload background processing from the device into the cloudNo need to use the battery, CPU cycles and memory on the deviceInitiated by the server to enable key background scenariosAKA ‘Smart Multitasking’Users can focus on the foreground application that has as much resources as possible availableYou (as a developer) can notify the user through the server if there is something they should know about or react upon
There are three types of push notifications that you can use on a Windows PhoneNotifications that show up when your application is not running:Tile UpdateToast NotificationNotification that show up when your application is running:Possibility to immediately update your UITile UpdateImagine an application that gets photo feeds, for instance from a service like flickr. Currently the tile shows there are 14 pictures available[Animate]Something happens on the backend: new pictures become available. Through push notifications the tile can be updated[Animate]Toast NotificationImagine a weather application. The user has indicated that they want to be informed about weather updates. Currently the user is not using the weather application though.[Animate]You can send a toast to the device. It appears on the screen, regardless of what the user is doing on the device. If the user clicks on the toast, your application will be launched.[Animate]Push Notification while your application is runningInstead of polling for changes, you setup a push notification (meaning your application will wait for something to happen on the backend with no polling necessary). When something happens on the backend, the server will ping your application.[Animate]The application can take immediate action, for instance to display a newly received message to the user.
Explain in a bit of detail how push notifications work (numbers correspond to next animation)Start with your application running on the deviceThe user indicates that they are interested in some notifications that your application can receiveYou are opening a push channel inside your application with the push clientThe push client returns a unique (per device and per application) URI to your applicationThe URI points to some live service hosted by Microsoft, somewhere in the cloudYour application sends that unique URI to your own back end serviceCan use any mechanismCan use any type of authenticationCan use custom protocolsYour service just sits somewhere in the cloud, waiting for something to happenIf something interesting happens ….Your service takes the event data and posts it to the unique URINo magic, just an ordinary http POSTThe Push Service takes the data you gave it and uses the URL to identify the device and the applicationThe data is send to the deviceDepending on the state of the device and the type of notification, the notification willAppear in the application (where you are responsible to display it to the user)Show up as a toast notification (the operating system takes care of this)Update a tile (the operating system takes care of this)
I highly recommend using the Weather application from the Windows Phone Developer Training Kit. This is an excellent example of building push notifications, and is something that the audience can use later to model their own applications against.
DEMOS TO DO:MyLittleTeapot
DEMOS TO DO:SearchExtensibilitySample
The bold (red-bulleted)options are new to Windows Phone 7.1
DEMOS TO DO:RingtoneSampleChoosers – Final Solution
Applications are built in pagesGives your application easy navigationGives your application integration with the back keyMakes things easier when your application needs to handle pause and resumeA Windows Phone UI is really clean and simpleIf you have a strong brand (e.g. making your own controls bright and flashy), you can show thatHowever, if you want to look like the default applications, be clean and simpleNotification and location services can really be used to help turn your application into a better user experience