Sascha P. Corti<br />Developer Evangelist, Microsoft Switzerland<br />sascha.corti@microsoft.com | blog | twitter<br />Man...
Windows Phone 7 “Mango”<br />
Windows Phone<br />“Mango”<br />Cloud and Integration Services<br />App Model<br />UI Model<br />Calendar Contacts Maps<br...
Multi-Tasking<br />MultiTasking<br />Cloud and Integration Services<br />App Model<br />UI Model<br />Software Architectur...
Start in Foreground<br />Continue in Background<br />Multitasking<br />current<br />fav<br />0:09<br />0:10<br />0:11<br /...
Multitasking<br />Sascha has just checked in @MSFT.<br />FourSquare<br />auto<br />Start in Background<br />Continue & Fin...
Background Notification Service<br />Alarms<br />usingMicrosoft.Phone.Scheduler;<br />privatevoidAddAlarm(object sender, R...
Background Notification Service<br />Reminders<br />usingMicrosoft.Phone.Scheduler;<br />privatevoidAddReminder(object sen...
Background Transfer Service<br />usingMicrosoft.Phone.BackgroundTransfer;<br />voidDownloadWithBTS(UrisourceUri, Uridestin...
Background Transfer Service<br />demo…<br />
Generic Background Agents<br />Occurrence: 	Every 30 min<br />Duration: 	15 seconds<br />Scenarios: 	Incremental Data Sync...
Background Agents<br />demo…<br />
Application Lifecycle<br />Fast App Switching<br />Cloud and Integration Services<br />App Model<br />UI Model<br />Softwa...
Faster user experience!<br />Enabled for all Mango apps<br />Recompile & Test your WP7 application<br />New Application Re...
Fast App Resume<br />State isPreserved<br />running<br />Save App State!<br />deactivated<br />activated<br />dormant<br /...
running<br />deactivated<br />activated<br />Resuming . .   . <br />dormant<br />Application Lifecycle<br />RestoreState !...
running<br />deactivated<br />activated<br />dormant<br />Application Lifecycle<br />tombstoned<br />Tombstoned<br />Appli...
Fast App Switching Check List<br />When Deactivated: save state (same as today)<br />When Activated: restore state if tomb...
Multitasking Cheat Sheet<br />
New Sensor Capabilites<br />Cloud and Integration Services<br />Camera“Motion”<br />Compass<br />Gyro<br />App Model<br />...
New Scenarios Enabled<br />Barcode Scanner<br />Sudoku Puzzle Solver<br />Custom<br />Camera<br />3D Virtual World<br />AR...
Hardware Sensors & API<br />Accelerometer<br />Compass<br />Not Mandatory in HW<br />(but present if Gyro is)<br />Gyro<br...
Accessing the Camera<br />PhotoCamera Class<br />New API developed for WP<br />Silverlight WebCam API<br />Ported from SL4...
Motion & Accelerometer<br />demo…<br />
Local Database<br />Cloud and Integration Services<br />SQL CE<br />App Model<br />UI Model<br />Software Architecture<br ...
Local Data Storage: Overview<br />Apps store private data in Isolated Storage<br />Settings and properties in the app dict...
Code First Development<br />Design time<br /><ul><li>Create Object Model
Decorate Objects with Attributes for Persistence</li></ul>Varietals<br />Wines<br /><ul><li>Create DataContextReference to...
Translate Object Modelinto a Database File
Submit API Persists Changes to DB</li></ul>Run time<br />Vineyards<br />WineMakers<br />Database upgrade<br /><ul><li>Crea...
Use Upgrade APIs to Change DB</li></li></ul><li>“Mango” Updated Developer Tools<br />
Emulator & Developer Tools<br />Tools Enhancements<br />Integrated Profiler <br />Visual , Code and Memory profiler<br />P...
Marketplace Test Kit<br />
Developer ToolsSimulating GPS Data & SensorsProfilingMarketplace Test Kit<br />demo…<br />
Live Tile Improvements<br />Live Tiles<br />Cloud and Integration Services<br />App Model<br />UI Model<br />Software Arch...
Local Tile APIs<br />Full Control of ALL Properties<br />Multiple Tiles per app<br />Create, Update / Delete / Query<br />...
Back of Tile Updates<br />Full Control of all Properties when your App is in Foreground or Background<br />Content, Title,...
The New Market Place<br />Fresh Mango Apps<br />
What’s New on the Marketplace?<br />Deep Link<br />http://windowsphone.com/s?appid=8bda38b9-619e-4368-b849-d25630266c4b<br...
Marketplace: Distribution Options<br />* People who obtain deeplink can access<br />
Marketplace: New Regions<br />1.8 Billion More Potential Users<br />Resubmit your App to reach New Markets!<br />Hong Kong...
7 things to check before you hit submit<br />No network, No problem?<br />< 90MB?<br />Theme aware?<br />Handles exception...
Resources<br />
Online Resources I : The Basics<br />
Online Resources II : Videos<br />
Online Resources III : Other<br />
Online Resources IV : 3rd Party<br />
© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be...
Backup Slides<br />
Demo Title<br />demo…<br />
Windows Phone 7 “Mango”Overview<br />
Multi-tasking<br />Enhanced Phone Framework<br />XNA Silverlight Integration<br />Integrating with the phone<br />Performa...
Fast Application Resume<br />Ability to resume applications that the user has recently used<br />Apps stay in memory unles...
Integrating with the Phone<br />51<br />
Expanding the Phone Framework<br />52<br />
Silverlight Investments<br />53<br />
Tools Investments<br />
Platform Architecture<br />
Software Architecture<br />Your App UI and logic<br />Applications<br />Frameworks<br />HTML5/JavaScript<br />Silverlight ...
Frameworks Details<br />Windows Phone Frameworks<br />Launchers & Choosers<br />Windows Phone Controls<br />Camera<br />De...
New Sensor Capabilites<br />
Sensors: Good to Know<br />Need hardware to debug most scenarios<br />Camera, motion, compass, & gyro require hardware<br ...
Local Database<br />
LINQ to Everything<br />LINQ<br />Objects<br />XML<br />SQL<br />User Data<br />OData<br />WP7<br />Mango<br />
Database Creation: Example<br />// Define the data context.<br />publicpartialclassWineDataContext : DataContext<br />{<br...
Application Lifecycle<br />
Methods &Events<br />
Deactivation Resource Management<br />Deactivated App<br />MediaPlayer.Pause<br />MediaElement.Pause<br />SoundEffectInsta...
Activation Resource Management<br />Running App<br />MediaElement.Source/Position/Play<br />Socket.ConnectAsync<br />new P...
Multi-Tasking<br />MultiTasking<br />Cloud and Integration Services<br />App Model<br />UI Model<br />Software Architectur...
Background Audio – HTML5<br /><audioid="audio_tag"<br />controls="controls"<br />src="http://html5audio.com/Demo1.mp3"<br ...
Background Audio – Streaming<br />Background Audio – URL Based<br />voidPlayStateChanged(objectsender, EventArgs e)<br />{...
End-To-End Architecture<br />Application<br />OS<br />Developer<br />myapp.dll<br />Single App<br />UX<br />Logic<br />Dif...
Periodic Agent Sample<br />privatevoidStartSearchAgent(object sender, RoutedEventArgs e)<br />{<br />PeriodicTasktask = ne...
Contacts & Calendar<br />
Chooser Tasks related to user data<br />EmailAddressChooserTask<br />PhoneNumberChooserTask<br />AddressChooserTask<br />M...
Contacts: Hello, World!<br />Contactscontacts = newContacts();<br />contacts.SearchCompleted+= newEventHandler<ContactsSea...
Appointments: Hello, World!<br />Appointmentsappointments = newAppointments();<br />appointments.SearchCompleted+= newEven...
Upcoming SlideShare
Loading in …5
×

Windows Phone 7.5 Mango - What's New

3,528 views

Published on

SoftShake 2011 Geneva - Microsoft Track - "Windows PHone 7.5 Mango - What's New"

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,528
On SlideShare
0
From Embeds
0
Number of Embeds
18
Actions
Shares
0
Downloads
113
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Make the point that we are now going to use this diagram to go through the life cycle of an application.
  • EmailAddressChooser and PhoneNumberChooser now return display name.
  • Windows Phone 7.5 Mango - What's New

    1. 1. Sascha P. Corti<br />Developer Evangelist, Microsoft Switzerland<br />sascha.corti@microsoft.com | blog | twitter<br />Mango<br />inside<br />Windows Phone 7 MangoOverview for Developers<br />
    2. 2. Windows Phone 7 “Mango”<br />
    3. 3. Windows Phone<br />“Mango”<br />Cloud and Integration Services<br />App Model<br />UI Model<br />Calendar Contacts Maps<br />Extras, Tiles<br />Push, Alerts<br />Software Architecture<br />Silverlight and XNA Integration<br />Fast App Switch<br />Multitasking<br />Hardware Foundation<br />Gen GC<br />SQL CE<br />Silverlight 4.0<br />Sockets<br />Camera, Sensors & Motion<br />Gyro<br />Flexible chassis<br />
    4. 4. Multi-Tasking<br />MultiTasking<br />Cloud and Integration Services<br />App Model<br />UI Model<br />Software Architecture<br />Hardware Foundation<br />
    5. 5. Start in Foreground<br />Continue in Background<br />Multitasking<br />current<br />fav<br />0:09<br />0:10<br />0:11<br />0:12<br />9:00 AM<br />Friday<br />October 21<br />TechDays 2011 Fall<br />Bern<br />9:00 AM – 6:00 PM<br />Words<br />ByPaul van Dyk<br />
    6. 6. Multitasking<br />Sascha has just checked in @MSFT.<br />FourSquare<br />auto<br />Start in Background<br />Continue & Finish in <br />Background<br />Foreground<br />favori<br />GlattZentru<br />Wallisellen, Zürich<br />Microsoft<br />Wallisellen, Zürich<br /><br />
    7. 7. Background Notification Service<br />Alarms<br />usingMicrosoft.Phone.Scheduler;<br />privatevoidAddAlarm(object sender, RoutedEventArgs e)<br />{<br /> Alarmalarm = newAlarm("Long Day");<br />alarm.BeginTime= DateTime.Now.AddSeconds(15);<br />alarm.Content= "It's been a long day. Go to bed.";<br />alarm.Title= "Alarm";<br />ScheduledActionService.Add(alarm);<br />}<br />Modal<br />Snooze and Dismiss<br />Sound Customization<br />No App Invocation<br />No Stacking<br />
    8. 8. Background Notification Service<br />Reminders<br />usingMicrosoft.Phone.Scheduler;<br />privatevoidAddReminder(object sender, RoutedEventArgs e)<br />{<br />Reminderreminder = newReminder("CompanyMeeting");<br />reminder.BeginTime = DateTime.Now.AddSeconds(15);<br />reminder.Content = "Soccer Fields by The Commons";<br />reminder.Title = "Microsoft Annual Company Product Fair 2009";<br />reminder.RecurrenceType = RecurrenceInterval.Yearly;<br />reminder.NavigationUri= newUri("/Reminder.xaml", UriKind.Relative);<br />ScheduledActionService.Add(reminder);<br />}<br />Persisted Across Reboots<br />Rich Information<br />Integrates with other Reminders<br />Snooze and Dismiss<br />Launch App<br />Follows Phone Global Settings<br />
    9. 9. Background Transfer Service<br />usingMicrosoft.Phone.BackgroundTransfer;<br />voidDownloadWithBTS(UrisourceUri, UridestinationPath)<br />{<br />btr= newBackgroundTransferRequest(sourceUri, destinationUri);<br />btr.TransferStatusChanged += BtsStatusChanged;<br />btr.TransferProgressChanged+= BtsProgressChanged;<br />BackgroundTransferService.Add(btr);<br />}<br />voidBtsProgressChanged(object sender, BackgroundTransferEventArgs e)<br />{<br />DrawProgressBar(e.Request.BytesReceived);<br />}<br />voidGetCurrentProgress()<br />{<br />DrawProgressBar(btr.BytesReceived);<br />}<br />My WP Book App<br />download<br /><br />Ready Player One<br />completed<br /><br />Jpod<br />Cloud<br />My WP<br />Book App<br />Great Mysteries o<br />Background Transfer Service<br />POST<br /><~3.0 MB<br />WP7 for Devs<br /><20 MB<br />GET<br /> < 100 MB<br />ISO Store<br />
    10. 10. Background Transfer Service<br />demo…<br />
    11. 11. Generic Background Agents<br />Occurrence: Every 30 min<br />Duration: 15 seconds<br />Scenarios: Incremental Data Sync<br />Agents<br />Periodic<br />On Idle<br />May have One or Both<br />Initialized in Foreground, Run in Background<br />Persisted across Reboots<br />User control through Control Panel<br />Up to a Maximum of 18 periodic agents<br />Synchronize with Foreground through Mutex<br />Agent runs for up to 14 Days (can be renewed)<br />Occurrence: External power, non-cell network<br />Duration: 10 minutes<br />Scenarios: Data Feasting<br />
    12. 12. Background Agents<br />demo…<br />
    13. 13. Application Lifecycle<br />Fast App Switching<br />Cloud and Integration Services<br />App Model<br />UI Model<br />Software Architecture<br />Hardware Foundation<br />
    14. 14. Faster user experience!<br />Enabled for all Mango apps<br />Recompile & Test your WP7 application<br />New Application Resume UX<br />WindowsPhone 7.5Mango<br />WindowsPhone 7<br />Resuming . . . <br />Tap andhold<br />Tap<br />
    15. 15. Fast App Resume<br />State isPreserved<br />running<br />Save App State!<br />deactivated<br />activated<br />dormant<br />Application Lifecycle<br />Phone resources detached<br />Threads & timers suspended<br />Tombstoned<br />Tombstoned<br />Tombstoned<br />Application_Deactivated<br />Application_Activated<br />Application_Launching<br />10<br />
    16. 16. running<br />deactivated<br />activated<br />Resuming . . . <br />dormant<br />Application Lifecycle<br />RestoreState !<br />Restore App State<br />tombstoned<br />Tombstoned<br />Application_Activated<br />Tombstone <br />the oldest app<br />
    17. 17. running<br />deactivated<br />activated<br />dormant<br />Application Lifecycle<br />tombstoned<br />Tombstoned<br />Application_Closing<br />10<br />
    18. 18. Fast App Switching Check List<br />When Deactivated: save state (same as today)<br />When Activated: restore state if tombstoned& attach resources as needed<br />App cannot run code behind Launchers/Choosers<br />App can continue running under Locked Screen<br />Debugyour App when Tombstoned<br />Apps in Marketplace work as of today<br />Will be Tombstoned when deactivated<br />Recompile Windows Phone 7 Apps  Test  Submit<br />
    19. 19. Multitasking Cheat Sheet<br />
    20. 20. New Sensor Capabilites<br />Cloud and Integration Services<br />Camera“Motion”<br />Compass<br />Gyro<br />App Model<br />UI Model<br />Software Architecture<br />Hardware Foundation<br />
    21. 21. New Scenarios Enabled<br />Barcode Scanner<br />Sudoku Puzzle Solver<br />Custom<br />Camera<br />3D Virtual World<br />AR Overlays<br />
    22. 22. Hardware Sensors & API<br />Accelerometer<br />Compass<br />Not Mandatory in HW<br />(but present if Gyro is)<br />Gyro<br />Not Mandatory in HW<br />MotionSensor<br />All the Sensor + Math<br />Use whenever available<br />Also works w/o Gyro<br />IndividualAPIs availablefor all Sensors<br />HARDWARE<br />APIs<br />Motion Sensor<br />cosγ.cos α−cosβ.sinα+sinβ.sinγ.cosαsinβ.sinα+ cosβ.sinγ.cosαcosγ.sin αcosβ.cosα+sinβ.sinγ.sinα−sinβ.cosα+ cosβ.sinγ.sinα−sinγsinβ.cosγcosβ.sinγ<br /> <br />NEW<br />NEW<br />
    23. 23. Accessing the Camera<br />PhotoCamera Class<br />New API developed for WP<br />Silverlight WebCam API<br />Ported from SL4 Desktop with added functionality<br />Build Augmented Reality App (with MotionSensor)<br />Display in your App: VideoBrush<br />Build custom Camera App<br />
    24. 24. Motion & Accelerometer<br />demo…<br />
    25. 25. Local Database<br />Cloud and Integration Services<br />SQL CE<br />App Model<br />UI Model<br />Software Architecture<br />Hardware Foundation<br />
    26. 26. Local Data Storage: Overview<br />Apps store private data in Isolated Storage<br />Settings and properties in the app dictionary<br />Unstructured data in Isolated Storage files <br />Structured data in database files<br />App Root Folder<br />Install<br />Package Manager<br />Creates root folder<br />sandboxed to App<br />DB<br />Database<br />File (r/o)<br />App Data Folder<br />Creates/Manages<br />files and settings<br />App<br />WP7 Isolated Storage APIs<br />DB<br />Application<br />Settings File<br />Application<br />Files<br />Database file<br />
    27. 27. Code First Development<br />Design time<br /><ul><li>Create Object Model
    28. 28. Decorate Objects with Attributes for Persistence</li></ul>Varietals<br />Wines<br /><ul><li>Create DataContextReference to Database
    29. 29. Translate Object Modelinto a Database File
    30. 30. Submit API Persists Changes to DB</li></ul>Run time<br />Vineyards<br />WineMakers<br />Database upgrade<br /><ul><li>Create new Objects to Enable new Features
    31. 31. Use Upgrade APIs to Change DB</li></li></ul><li>“Mango” Updated Developer Tools<br />
    32. 32. Emulator & Developer Tools<br />Tools Enhancements<br />Integrated Profiler <br />Visual , Code and Memory profiler<br />Performance Analysis<br />Built-in anti-pattern analyzer<br />Guides through step-by-step<br />Background Agent Debugging<br />Emulator Enhancements<br />Memory model improvements<br />Emulator can handle physical memory fragmentations<br />Media support for H.264, AAC<br />Sensor Support<br />Accelerometer and Location<br />Multi-Touch<br />
    33. 33. Marketplace Test Kit<br />
    34. 34. Developer ToolsSimulating GPS Data & SensorsProfilingMarketplace Test Kit<br />demo…<br />
    35. 35. Live Tile Improvements<br />Live Tiles<br />Cloud and Integration Services<br />App Model<br />UI Model<br />Software Architecture<br />Hardware Foundation<br />
    36. 36. Local Tile APIs<br />Full Control of ALL Properties<br />Multiple Tiles per app<br />Create, Update / Delete / Query<br />Launches directly to In App URI <br />Live Tile Improvements<br />Secondary Tile<br />Launches world news page<br />Secondary Tile<br />Launches local news page<br />Application Tile<br />Launches main app experience<br />
    37. 37. Back of Tile Updates<br />Full Control of all Properties when your App is in Foreground or Background<br />Content, Title, Background<br />Flips from Front to Back at random Interval<br />Smart Logic make Flips Asynchronous<br />Live Tiles – Local Tile API<br />Content string is bigger<br />Content<br />Background<br />Title<br />Title<br />
    38. 38. The New Market Place<br />Fresh Mango Apps<br />
    39. 39. What’s New on the Marketplace?<br />Deep Link<br />http://windowsphone.com/s?appid=8bda38b9-619e-4368-b849-d25630266c4b<br />ITIN<br />Resubmit Apps to Reach New Markets!<br />
    40. 40. Marketplace: Distribution Options<br />* People who obtain deeplink can access<br />
    41. 41. Marketplace: New Regions<br />1.8 Billion More Potential Users<br />Resubmit your App to reach New Markets!<br />Hong Kong<br />Singapore<br />
    42. 42. 7 things to check before you hit submit<br />No network, No problem?<br />< 90MB?<br />Theme aware?<br />Handles exceptions?<br />Back button works as expected?<br />User consent dialogs & settings?<br />Pauses/resumes user’s music?<br />MarketPlace: Certification Checklist<br />
    43. 43. Resources<br />
    44. 44. Online Resources I : The Basics<br />
    45. 45. Online Resources II : Videos<br />
    46. 46. Online Resources III : Other<br />
    47. 47. Online Resources IV : 3rd Party<br />
    48. 48. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.<br />The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.<br />
    49. 49. Backup Slides<br />
    50. 50. Demo Title<br />demo…<br />
    51. 51. Windows Phone 7 “Mango”Overview<br />
    52. 52. Multi-tasking<br />Enhanced Phone Framework<br />XNA Silverlight Integration<br />Integrating with the phone<br />Performance <br />Database Access<br />Complete the push notification and Tile experience<br />Marketplace Services<br />Sockets<br />Major Investment Areas<br />
    53. 53. Fast Application Resume<br />Ability to resume applications that the user has recently used<br />Apps stay in memory unless memory is needed for other apps<br />*Every* app should do this<br />Background Agents<br />Ability to run your code in the background<br />Audio, Timed or on Idle<br />Notifications<br />Ability to create alarms and reminders<br />UX and behavior is the same as the phone Alarms and Calendar items<br />Background Transfer Service<br />Application can queue up transfers in the background<br />Multitasking Themes<br />
    54. 54. Integrating with the Phone<br />51<br />
    55. 55. Expanding the Phone Framework<br />52<br />
    56. 56. Silverlight Investments<br />53<br />
    57. 57. Tools Investments<br />
    58. 58. Platform Architecture<br />
    59. 59. Software Architecture<br />Your App UI and logic<br />Applications<br />Frameworks<br />HTML5/JavaScript<br />Silverlight and XNA<br />User data<br />Structured data<br />CLR<br />App Model<br />UI Model<br />Cloud Integration<br />App management<br />Licensing<br />Chamber isolation<br />Software updatesData sharing<br />Shell frame <br />Session manager<br />Direct3D<br />Compositor<br />Xbox LIVE<br />Bing<br />Location<br />Push notifications<br />Windows Live ID<br />Kernel<br />Hardware BSP<br />Security<br />Networking<br />Storage<br />A-GPS Accelerometer Gyro Compass Light Proximity<br />Media Wi-Fi Radio Graphics <br />Hardware Foundation<br />
    60. 60. Frameworks Details<br />Windows Phone Frameworks<br />Launchers & Choosers<br />Windows Phone Controls<br />Camera<br />Device Integration<br />MultiTasking<br />Structured Data<br />PhoneApplicationPage<br />PushNotification<br />WebBrowserControl<br />Sensors<br />PhoneApplicationFrame<br />Silverlight Presentation and Media<br />XNA Frameworks for Games<br />Controls<br />Drawing<br />IsolatedStorage<br />Drawing<br />GamerServices<br />Silverlight Integration<br />Silverlight<br />4.0<br />Media<br />Graphics<br />Shapes<br />Markup<br />Media<br />Navigation<br />Audio<br />Content<br />Input<br />Application Object<br />Common Base Class Library<br />Globalization<br />IO<br />Resources<br />Reflection<br />Text<br />Location<br />Runtime<br />Diagnostics<br />Net<br />Sockets<br />Configuration<br />Collections<br />ComponentModel<br />Security<br />Threading<br />ServiceModel<br />Linq<br />
    61. 61. New Sensor Capabilites<br />
    62. 62. Sensors: Good to Know<br />Need hardware to debug most scenarios<br />Camera, motion, compass, & gyro require hardware<br />For accelerometer, you can use the emulator!<br />Motion sensor will try it’s best<br />Works best with all three sensors<br />Will also work if only compass and accelerometer are present<br />Camera <br />Output for video recorded is MP4<br />Always check for device specific support for Flash mode<br />Use Y or YUV format for processing samples – faster than ARGB<br />
    63. 63. Local Database<br />
    64. 64. LINQ to Everything<br />LINQ<br />Objects<br />XML<br />SQL<br />User Data<br />OData<br />WP7<br />Mango<br />
    65. 65. Database Creation: Example<br />// Define the data context.<br />publicpartialclassWineDataContext : DataContext<br />{<br />publicTable<Wine> Wines;<br />publicTable<Vineyard> Vineyards;<br />publicWineDataContext(string connection) : base(connection) { }<br />}<br />// Define the tables in the database<br />[Table]<br />publicclassWine<br />{<br />[Column(IsPrimaryKey=true]<br />publicstringWineID { get; set; }<br />[Column]<br />publicstring Name { get; set; }<br />……<br />}<br />// Create the database form data context, using a connection string<br />DataContextdb = newWineDataContext("isostore:/wineDB.sdf");<br />if (!db.DatabaseExists()) db.CreateDatabase();<br />
    66. 66. Application Lifecycle<br />
    67. 67. Methods &Events<br />
    68. 68. Deactivation Resource Management<br />Deactivated App<br />MediaPlayer.Pause<br />MediaElement.Pause<br />SoundEffectInstance.Pause<br />VibrateController.Stop<br />PhotoCamera.Dispose<br />Save Page / Global State<br />PhoneApplicationPage.<br />OnNavigatedFrom<br />PhoneApplicationService.<br />Deactivated<br />Framework:<br />Detach Resources<br />Framework:<br />Suspend Timers and Threads<br />Dormant App<br />
    69. 69. Activation Resource Management<br />Running App<br />MediaElement.Source/Position/Play<br />Socket.ConnectAsync<br />new PhotoCamera/VideoCamera<br />Restore app state if tombstoned<br />PhoneApplicationPage.<br />OnNavigatedTo<br />PhoneApplicationService.<br />Activated<br />Framework:<br />Attach Resources<br />Framework:<br />Resume Timers and Threads<br />Dormant App<br />
    70. 70. Multi-Tasking<br />MultiTasking<br />Cloud and Integration Services<br />App Model<br />UI Model<br />Software Architecture<br />Hardware Foundation<br />
    71. 71. Background Audio – HTML5<br /><audioid="audio_tag"<br />controls="controls"<br />src="http://html5audio.com/Demo1.mp3"<br />onplay="StartPlayback()"<br />onended="NextTrack()"<br /></audio><br />functionNextTrack() {<br />musicPlayer = document.getElementById("audio_tag");<br />musicPlayer.src = 'http://html5audio.com/Demo2.mp3';<br />}<br />9:00 AM<br />Friday<br />October 21<br />TechDays 2011 Fall<br />Bern<br />9:00 AM – 6:00 PM<br />Cloud<br />Browser<br />Zune Service<br />www.html5audio.<br />++<br />
    72. 72. Background Audio – Streaming<br />Background Audio – URL Based<br />voidPlayStateChanged(objectsender, EventArgs e)<br />{<br /> switch(player.PlayerState)<br /> {<br /> casePlayState.FastForwarding:<br />// Move to next track<br />break;<br /> }<br />}<br />Player =BackgroundAudioPlayer.Instance;<br />player.PlayStateChanged += new eventHandler(PlayStateChanged);<br />AudioTracktrack = newAudioTrack(newUri("/audiofile.mp3"),…);<br />current<br />fav<br />player.Play();<br />0:09<br />0:10<br />0:11<br />0:12<br />9:00 AM<br />Friday<br />October 21<br />TechDays 2011 Fall<br />Bern<br />9:00 AM – 6:00 PM<br />Cloud<br />Words<br /> Paul van Dyk<br />My Music<br />App<br />Zune Service<br />++<br />Buffer<br />ISO Store<br />++<br />Buffer<br />
    73. 73. End-To-End Architecture<br />Application<br />OS<br />Developer<br />myapp.dll<br />Single App<br />UX<br />Logic<br />Different<br />Processes<br />System Services<br />ISO Store<br />Cloud<br />Logic<br />myappagent.dll<br />
    74. 74. Periodic Agent Sample<br />privatevoidStartSearchAgent(object sender, RoutedEventArgs e)<br />{<br />PeriodicTasktask = newPeriodicTask("twitter");<br />task.Description= "Gets latest tweet";<br />task.ExpirationTime= DateTime.Now.AddDays(7);<br />ScheduledActionService.Add(task);<br />}<br /><Tasks><br /> <DefaultTaskName ="_default"<br />NavigationPage="MainPage.xaml"/><br /><ExtendedTaskName="BgTask"><br /> <BackgroundServiceAgent<br />Speer="ScheduledTaskAgent"<br /> Name="TwitterAgent"Source="TweetAgent"<br />Type="TweetAgent.TweetAgent"/><br /></ExtendedTask> <br /></Tasks><br />publicclassTweetAgent : ScheduledTaskAgent<br />{<br /> publicoverridevoidOnInvoke(ScheduledTask Task)<br /> {<br />// Do some background work<br />NotifyComplete();<br /> };<br />}<br />
    75. 75. Contacts & Calendar<br />
    76. 76. Chooser Tasks related to user data<br />EmailAddressChooserTask<br />PhoneNumberChooserTask<br />AddressChooserTask<br />Microsoft.Phone.UserData for direct access<br />Contacts<br />Appointments<br />New and updated APIs in “Mango”<br />
    77. 77. Contacts: Hello, World!<br />Contactscontacts = newContacts();<br />contacts.SearchCompleted+= newEventHandler<ContactsSearchEventArgs>((sender, e) =><br /> {<br />...= e.Results;<br /> });<br />// E.g. search for all contacts<br />contacts.SearchAsync(string.Empty, FilterKind.None, null);<br />state<br />// E.g. search for all contacts with display name matching "Sa"<br />contacts.SearchAsync("Sa", FilterKind.DisplayName, null);<br />filter expression<br />(not a regex)<br />Filter kind: name, email , phone or pinned to start)<br />
    78. 78. Appointments: Hello, World!<br />Appointmentsappointments = newAppointments();<br />appointments.SearchCompleted+= newEventHandler<AppointmentsSearchEventArgs>((sender, e) =><br /> {<br />... = e.Results;<br /> });<br />// E.g. get next appointment (up to 1 week away)<br />appointments.SearchAsync(DateTime.Now,<br />DateTime.Now+ TimeSpan.FromDays(7),<br /> 1, null);<br />start date and time<br />end date and time<br />state<br />Maximum items to return<br />
    79. 79. Be responsible<br />Your privacy policy should cover how you use the user’s contact information<br />Keep out of the way<br />Users have widely varying contact list sizes <br />Your UI should handle delays gracefully <br />Don’t let data get stale<br />Data returned is a snapshot<br />Refresh state when reasonable<br />Performance and Best Practices<br />
    80. 80. New Choosers and Launchers<br />New<br />SaveRingtoneTask<br />AddressChooseTask<br />BingMapsTask<br />BingMapsDirectionsTask<br />GameInviteTask<br />Updates:<br />EmailAddressChooserTask <br />PhoneNumberChooserTask<br />
    81. 81. AddressChooserTask<br />privateAddressChooserTaskaddressChooserTask;<br />// Constructor<br />publicMainPage()<br />{<br />this.addressChooserTask= newAddressChooserTask();<br />this.addressChooserTask.Completed += new<br />EventHandler<AddressResult>(<br />addressChooserTask_Completed);<br />}<br />privatevoidaddressChooserTask_Completed(objectsender, AddressResulte)<br />{<br />if(null == e.Error && TaskResult.OK == e.TaskResult)<br /> {<br />... = e.DisplayName;<br />... = e.Address;<br />}<br />}<br />
    82. 82. Microsoft.Phone.UserData<br />Important points<br />Contacts and Appointments APIs are read only<br />Third party social network data cannot be shared<br />
    83. 83. Contacts/Appointments Data Shared<br />
    84. 84. The New Market Place<br />
    85. 85. MarketPlace: Improvements<br />
    86. 86. Distribute pre-certified Apps to a Set of Beta Users<br />Capabilities <br />Developer selects List of Testers (up to 100)<br />Developer sends Email with Private Deeplink to the Testers <br />Only Testers selected in App Hub can test the Application and provide Feedback for 90 days<br />Beta cannot be updated<br />Benefits<br />No need to unlock Phones to test Apps<br />New Beta Distribution Service<br />

    ×