- Windows Phone 7 „Mango“ – what’s new for Developers?


Published on

Sascha Corti

Just a year after Windows Phone 7 was released to the market, Microsoft is updating the already widely popular platform to a new release called “Mango”, which adds a lot of highly anticipated features, especially for developers.

This session will introduce you to what’s new in the Mango platform for you as a developer. Many samples will show you the latest additions including background agents, the new on-device database, how to make your application run in the background and how to create augmented-reality applications or create multiple live tiles per application, that can be easily updated from within the running app.

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide - Windows Phone 7 „Mango“ – what’s new for Developers?

  1. 1. cocktail d’expérience informatiques Genève 3 & 4 octobre 2011 Seconde édition soft-shake.chAuteur Sascha P. CORTI Track MicrosoftSession Windows Phone 7 Mango Overview for Developers
  2. 2. Windows Phone 7 MangoOverview for DevelopersSascha P Corti .Developer Evangelist, Microsoft | blog | twitter
  3. 3. Windows Phone 7 “Mango”
  4. 4. Windows Phone “Mango” Extras, Tiles Calendar Cloud and Contacts Integration Push, Alerts Maps Services Fast App Switch Silverlight and App UI XNA Model Model Multitasking Integration Software Gen GC SQL CE Architecture Silverlight 4.0 Sockets Hardware Camera, Sensors & Motion Foundation Gyro Flexible chassis
  5. 5. Cloud and Integration Services App UI Model Model Software Architecture Hardware FoundationMulti-Tasking
  6. 6. Multitasking Start in Foreground Continue in current fav Background 0:12 0:11 0:10 0:09 9:00 AM Friday Words 21 October ByPaul van Dyk TechDays 2011 Fall Bern 9:00 AM – 6:00 PM
  7. 7. Background Notification Service Alarms using Microsoft.Phone.Scheduler; private void AddAlarm(object sender, RoutedEventArgs e) { Alarm alarm = new Alarm("Long Day"); alarm.BeginTime = DateTime.Now.AddSeconds(15); alarm.Content = "Its been a long day. Go to bed."; alarm.Title = "Alarm"; ScheduledActionService.Add(alarm); } Modal Snooze and Dismiss Sound Customization No App Invocation No Stacking
  8. 8. Background Notification Service Reminders using Microsoft.Phone.Scheduler; private void AddReminder(object sender, RoutedEventArgs e) { Reminder reminder = new Reminder("CompanyMeeting"); reminder.BeginTime = DateTime.Now.AddSeconds(15); reminder.Content = "Soccer Fields by The Commons"; reminder.Title = "Microsoft Annual Company Product Fair 2009"; reminder.RecurrenceType = RecurrenceInterval.Yearly; reminder.NavigationUri = new Uri("/Reminder.xaml", UriKind.Relative); ScheduledActionService.Add(reminder); } Persisted Across Reboots Rich Information Integrates with other Reminders Snooze and Dismiss Launch App Follows Phone Global Settings
  9. 9. Background Transfer Service using Microsoft.Phone.BackgroundTransfer; void DownloadWithBTS(Uri sourceUri, UriBackgroundTransferEventArgs GetCurrentProgress() BtsProgressChanged(object sender, destinationPath) e) {My WP Book App { btr = new BackgroundTransferRequest(sourceUri, destinationUri); DrawProgressBar(btr.BytesReceived);download } btr.TransferStatusChanged += BtsStatusChanged; DrawProgressBar(e.Request.BytesReceived); btr.TransferProgressChanged += BtsProgressChanged; BackgroundTransferService.Add(btr); } Ready Player One completed Jpod POST Great Mysteries o <~3.0 MB WP7 for Devs My WP Background Book App Transfer <20 MB GET Cloud Service < 100 MB ISO Store
  10. 10. demo…Background Transfer Service
  11. 11. Generic Background Agents Occurrence: Every 30 min Duration: 15 seconds Agents Scenarios: Incremental Data Sync Periodic Occurrence: External power, non-cell network On Idle Duration: 10 minutes Scenarios: Data Feasting May have One or Both Initialized in Foreground, Run in Background Persisted across Reboots User control through Control Panel Up to a Maximum of 18 periodic agents Synchronize with Foreground through Mutex Agent runs for up to 14 Days (can be renewed)
  12. 12. demo…Background Agents
  13. 13. Cloud and Integration Services App UI Model Model Software Architecture Hardware FoundationApplication Lifecycle
  14. 14. New Application Resume UX Faster user experience! Enabled for all Mango apps Recompile & T your WP7 application est Resuming . . .
  15. 15. Application Lifecycle Fast App Resume State is Preserved running Tomb stoned Save App State! deacti Tomb activated vated stoned Tomb stoned Phone resources detached dormant Threads & timers suspended
  16. 16. Application Lifecycle Resuming . . . Restore State ! running deacti Tomb activated vated stonedTombstone tomb dormant the oldest stoned app
  17. 17. Application Lifecycle Tomb stoned running deacti activated vated tomb dormant stoned
  18. 18. Multitasking Cheat SheetJob ToolResume quickly from the lock screen Fast App SwitchingSet an alarm or reminder at a precise time Background NotificationUpload or download files Background TransferEvent-based toast/tile updates Push NotificationsLocation-based services; regular toast/tile Periodic Background Agentupdates; data pre-caching; etc.Play music in the background Background Audio PlayerSynchronize data; SETI@home; etc. Resource-Intensive AgentReal-time GPS tracking Run under the lock screen
  19. 19. Cloud and Integration Services App UI Model Model Software Architecture Hardware FoundationNew Sensor Capabilites
  20. 20. New Scenarios Enabled
  21. 21. Hardware Sensors & APIHARDWARE APIs Accelerometer MotionSensor All the Sensor + Math Use whenever available Compass Also works w/o Gyro Not Mandatory in HW (but present if Gyro is) Gyro Individual Not Mandatory in HW APIs available for all Sensors
  22. 22. demo…Motion & Accelerometer
  23. 23. Cloud and Integration Services App UI Model Model Software Architecture Hardware FoundationLocal Database
  24. 24. Local Data Storage: OverviewApps store private data in Isolated Storage Settings and properties in the app dictionary Unstructured data in Isolated Storage files App Root Folder Structured data in database files Install Creates root folder Package sandboxed to App Manager DB Database File (r/o) App Data Folder Creates/Manages App files and settings WP7 Isolated Storage APIs Application DB Application Settings File Files Database file
  25. 25. “Mango”Updated Developer Tools
  26. 26. Emulator & Developer ToolsEmulator Enhancements Tools Enhancements Memory model improvements Integrated Profiler Emulator can handle physical Visual , Code and Memory memory fragmentations profiler Media support for H.264, AAC Performance Analysis Sensor Support Built-in anti-pattern analyzer Accelerometer and Location Guides through step-by-step Multi-Touch Background Agent Debugging
  27. 27. Marketplace Test Kit
  28. 28. demo…Developer ToolsSimulating GPS Data & SensorsProfilingMarketplace Test Kit
  29. 29. Cloud and Integration Services App UI Model Model Software Architecture Hardware FoundationLive Tile Improvements
  30. 30. Live Tile ImprovementsLocal Tile APIs Full Control of ALL PropertiesMultiple Tiles per app Create, Update / Delete / Query Launches directly to In App URI
  31. 31. Live Tiles – Local Tile APIBack of Tile Updates Full Control of all Properties when your App is in Foreground or Background Content, Title, Background Content Content string is Background bigger Title Title Flips from Front to Back at random Interval Smart Logic make Flips Asynchronous
  32. 32. The New Market Place
  33. 33. What’s New on the Marketplace? ITIN Resubmit Apps to Reach New Markets!
  34. 34. Marketplace: Distribution Options “Beta” Private Public# of users 100 unlimited unlimitedApp Price Must be “free” Can be “paid” Can be “paid”Time Limited Expires after 90d No NoUpdateable No Yes YesCertification No Yes YesRequiredDiscoverable No No * YesAccess Control Limited to test user No No WLIDs providedTarget Users Beta Users Private Users Public Users* People who obtain deeplink can access
  35. 35. Marketplace: New Regions 1.8 Billion More Potential Users Resubmit your App to reach New Markets! Hong Kong Singapore Today (16) +19 New (35)
  36. 36. Resources
  37. 37. Online Resources I : The BasicsApp Hub http://create.msdn.comTools on MSDN Library “How To” Index UX Guide P&P Guide Dev Blog to WP Labs (RTM) Labs (Mango) SL Quick Starts
  38. 38. Online Resources II : VideosWP Jumpstart How To Videos “Absolute Beginners” WP on C9 Toolbox Game Dev Vids at MIX 11 Vids at TENA 11 Vids
  39. 39. Online Resources III : OtherApp Hub FAQ Hub Forums Walkthrough Walkthrough Requirements Samples on MSDN Toolkit for WP Toolkit for WP
  40. 40. Online Resources IV : 3rd PartySilverlight Show on WP spx?q=%5Bwindows-phone-7%5DWindows Phone Geek on Twitter on REDDIT on Stack ged/windows-phone-7
  41. 41. © 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.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.
  42. 42. Contacts: Hello, World!Contacts contacts = new Contacts();contacts.SearchCompleted += newEventHandler<ContactsSearchEventArgs>((sender, e) => { ... = e.Results; }); state// E.g. search for all contactscontacts.SearchAsync(string.Empty, FilterKind.None, null); filter expression Filter kind: name, email , phone (not a regex) or pinned to start)// E.g. search for all contacts with display name matching "Sa"contacts.SearchAsync("Sa", FilterKind.DisplayName, null);
  43. 43. Appointments: Hello, World!Appointments appointments = new Appointments();appointments.SearchCompleted += newEventHandler<AppointmentsSearchEventArgs>((sender, e) => { ... = e.Results; }); start date and time// E.g. get next appointment (up to 1 week away)appointments.SearchAsync(DateTime.Now, DateTime.Now + TimeSpan.FromDays(7), 1, null); end date and time Maximum items to return state
  44. 44. Performance and Best PracticesBe responsible Your privacy policy should cover how you use the user’s contact informationKeep out of the way Users have widely varying contact list sizes Your UI should handle delays gracefullyDon’t let data get stale Data returned is a snapshot Refresh state when reasonable
  45. 45. New Choosers and LaunchersNew SaveRingtoneT ask AddressChooseT ask BingMapsT ask BingMapsDirectionsT ask GameInviteTaskUpdates: EmailAddressChooserT ask PhoneNumberChooserT ask
  46. 46. AddressChooserTaskprivate AddressChooserTask addressChooserTask;// Constructorpublic MainPage(){ this.addressChooserTask = new AddressChooserTask(); this.addressChooserTask.Completed += new EventHandler<AddressResult>( addressChooserTask_Completed);}private void addressChooserTask_Completed(object sender, AddressResult e){ if (null == e.Error && TaskResult.OK == e.TaskResult) { ... = e.DisplayName; ... = e.Address; }}
  47. 47. Microsoft.Phone.UserDataImportant points Contacts and Appointments APIs are read only Third party social network data cannot be shared
  48. 48. Contacts/Appointments Data Shared Contact Name Other Contact Appointments and Picture Data / EventsWindows Live Social YES YES YESWindows Live Rolodex YES YES n/a(user created and SIM import)Exchange accounts YES YES YES(corporate plus Google, etc.)Operator Address Books YES YES n/aFacebook YES NO NOOther networks in the People NO NO NOHub (e.g., Twitter)
  49. 49. The New Market Place
  50. 50. MarketPlace: ImprovementsChallenges Fixed Challenges RemainingSupport Responsiveness. 98% of App certification consistency and testsupport inquiries are now responded results within 24 hours ID validation process is cumbersome.Free app submission limits. Revamping individual validationIncreased limit from 5 to 100 per year processMarket-specific registration W-8 form requirement (for non-USchallenges. Fixed registration form developers). Working to simplify andand postal code validation logic automateRegistration problems due to Xbox Submission process has errors.profile. Fixed the linking of developer Working to eliminate bottlenecksprofile information between App hub and streamline processand Registration payment failures forBlank or incomplete test results. some. Fixing remaining paymentNow providing complete certification exception scenarios.failure report
  51. 51. New Beta Distribution Service Distribute pre-certified Apps to a Set of Beta Users Capabilities Developer selects List of Testers (up to 100) Developer sends Email with Private Deeplink to the T esters Only T esters selected in App Hub can test the Application and provide Feedback for 90 days Beta cannot be updated Benefits No need to unlock Phones to test Apps